CSS/JS compression with PHP

When using Javascript and CSS extensively the sizes of these files are going to make a quite notable amount of a web site. Especially when using a JS framework it adds many KB to every file.

I stumbled across a solution for Javascript which also can – and has been used for CSS.

I tested the .htacces-solution in two projects and the reduction of the file size was really impressive. So far no problems where detected.

PS: When using a Javascript framework you might want to make sure you only include the parts you really need. I am using Scriptaculous mostly, which includes ALL modules by default. However it is very easy to reduce to what is really needed.

This entry was posted in HTML/JS, PHP. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s