Dear Log,
Somebody wrote to me the other day asking about how/whether they could memoize Locale::Maketext language handles in a mod_perl system they're writing under. I said how (altho the speed benefits are probably miniscule), but I also gave them my standard advice on such matters, which is this:
If you're worrying about page load-times, install mod_gzip before you start fretting over optimizing Perl. Secondly, tell your web designers to buy, read, absorb, and obey Zeldman's book Designing with Web Standards. This is not about fretting over HTML/XHTML distinctions, but about using CSS instead of <table> abominations. Using CSS in new pages/sites, instead of using table hell, will make your HTML saner for the programmers to deal with, and faster for transfer.
Yes, embedded tables can cause clients on slow machines to think real hard before rendering the page. Most browsers need to see the end table tag (</table>) before they will display anything on the page. Therefore, if the page can be redesigned so that there are a series of smaller tables, unembedded tables near the top of the page, those tables will be visible on the client-side sooner. This is a good trick to use if you have a giant, spreadsheet-looking thing that you need to generate. CSS can and does help in many, but not all, situations. I've become quite attached to CSS, foregoing my support for older browsers.
gzipping the page before it leaves apache seems like a waste of resources unless the page is large (let's say over 50K). Otherwise, the overhead of gzipping and ungziping will probably consume an transmission speed gains.
Re:CSS...good! gzip...not so good!
geoff on 2003-09-18T14:16:42
mod_gzip had logic in it (last time I checked) to avoid compressing files that were under a certain limit. whatever the limit was, I believe it was put in place because compressing small files actually ends up with a larger file in the end.
I'm not sure how mod_deflate does it in apache 2.0, though.
at any rate, compression is about saving bandwidth and not necessarily about saving client or server resources or speeding up a site.