Google’s mod_pagespeed module
Google has announced that they’ve created a nifty new Apache Web server module called mod_pagespeed that can speed up some Web sites.
We’ve been asked if we’re going to offer it, and the answer is “probably, but not yet”.
Why not yet?
We don’t install new software on our servers willy-nilly. New features that get added to the core of our systems need to be well-planned and well-tested.
The mod_pagespeed software is brand new and includes some warnings like “JavaScript minification is considered risky due to known bugs” and “there is an outstanding bug that the CSS parser can silently lose data”. You want us to be cautious. Honest! We’ll install it when we’re sure it’s ready for production use.
What will mod_pagespeed do?
The mod_pagespeed module can do a number of separate things.
One feature will help sites that have lots of recurring daily visitors: the Extend Cache filter, which uses a clever trick to refer to each changed version of a file using a separate URL with a “cache this URL for a year” header.
It does some other things that are already “best practice”, like combining CSS, but which might be more conveniently done using a module if you didn’t create the HTML pages yourself.
Recompressing images on the fly is something we’re skeptical of: best practice is definitely to optimize them before you upload them — but if you simply can’t do that for some reason, this might be the lesser of two evils.
It also has a feature that seems misguided at best: Remove Quotes, which eliminates “unnecessary” “quotation marks”. The mod_pagespeed documentation states that these quotation marks are “required by the various HTML specifications”, but that “browsers permit their omission”. This seems highly suspect to us. Google can’t possibly test every “browser”; there are almost certainly obscure HTTP clients using homebrew parsers that this will break, and the benefit is small compared to the risk.
Closing thoughts
Remember that mod_pagespeed, and many related tips like increasing image caching, using gzip compression, and optimizing images, are mostly focused on improving the download times of static files.
You also need to make sure that any scripts you use run quickly enough to avoid bogging down your site and limiting the peak number of visitors per second. If you do use scripts, you’ll want to use FastCGI for PHP and make good use of caching with WordPress and similar systems. (We have other WordPress tips, too.)
on Thursday, November 4, 2010 at 7:18 am (Pacific) Bruce Keener wrote:
If you are looking for webmasters who are willing to experiment with you on this, I’m certainly game for it. I’ve taken several steps to improve page speed, and am interested in experimenting with more.
Thanks for the post and the great work you guys are doing.