I've done a search for this but haven't seen it posted yet so I thought I'd share this performance tip.
I'm currently working on quite a large site with a lot of stuff going on in the front end - lightwindows, funky effects using moo and prototype, content related style sheets loaded from a bespoke cms, video overlays...all sorts of stuff.
To make all this trickery work pages had a lot of separate css and javascript files to load, which got me thinking about performance issues.
One problem is that when you start piling additional libraries and include files into a page it ups the number of http requests that you need to make on the server, which in turn slows down the page load time considerably.
One common performance tuning tip is to cut comments and whitespace out of your css and .js files and combine as many of them as possible to reduce the number of http requests. This is all well and good but it makes your scripts in particular a pig to maintain.
Anyway in searching around for a solution I came across a script called combine.php, which automatically combines your files, compresses them and caches them for later use.
The performance gains I've noticed are pretty remarkable on complex pages, but on the downside if you like to "code" visually (e.g. Dreamweaver "Designer" mode) your wysiwyg editor won't know what to do with your pages and will display them unstyled. Not really an issue for me but it's forcing my web designer colleague to learn some good hand coding practices
Anyway, more info from the authors blog here:
http://rakaz.nl/item/make_your_pages..._and_css_files
Hopefully some will find this useful.
|