Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Google mod_pagespeed for

2010, eclipse

Google have just released mod_pagespeed as an optimising caching module for Apache. It works by automatically minifying the content, much like existing minifiers work today but on any generated output rather than the source documents. As such, it's applicable for speeding up other types of site, like wikis, mailing list or newsgroup pages, generated CVS pages and the like.

I wrote up an overview over on InfoQ on the optimisations that it does, including:

  • Pre-shrinking images to the sizes specified in the HTML (if any)
  • Embedding images as data URLs for frequently used images
  • Pulling CSS into the HEAD of HTML pages
  • Merging multiple CSS files into one
  • And of course, standard minification like removal of comments, whitespace and the like

I wonder if could benefit from installing and using this module? There's certainly a lot of extraneous HTML whitespace on even the main page (and a number of others that are automatically generated from PHP and the like) which would result in smaller files, and thus faster delivery. There's also 29 images on the main page, some of which could be replaced with the data URLs, meaning less round-trips for the client-server communication.

However, it's released as binary-only (but not packaged in a particular format) for Linux x86/x86_64 Update: source is available for compilation. That means it may not be suitable as there's a variety of hardware that's used (as Denis keeps showing off :). It's also the kind of thing that you might not want to enable site-wide, at least initially.

Now, if only it could work on P2 repositories ...