Posted by: mrgierer | November 12, 2006

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.


Leave a response

Your response:

Categories