mod_pagespeed – why so hasty just yet?

by Ochronus on November 5, 2010

The net’s been loud with google’s mod_pagespeed lately.

According to the project page:

mod_pagespeed is an open-source Apache module that automatically optimizes web pages and resources on them. It does this by rewriting the resources using filters that implement web performance best practices. Webmasters and web developers can use mod_pagespeed to improve the performance of their web pages when serving content with the Apache HTTP Server.

mod_pagespeed includes several filter that optimize JavaScript, HTML and CSS stylesheets. It also includes filters for optimizing JPEG and PNG images. The filters are based on a set of best practices known to enhance web page performance. Webmasters who set up mod_pagespeed in addition to configuring proper caching and compression on their Apache distribution should expect to see an improvement in the loading time of the pages on their websites.

This all sounds very nice, so what are my objections? Read along.

First, I’m always very critical of automatic optimisation techniques. They shade developer responsibility and awareness and can do some disastrous, unintended modifications in the background.

My points are:

  • A web developer should have a clear knowledge about optimization techniques and do them in the template, css, etc.
  • Don’t impose additional load on the web server just because you lack the knowledge or you’re just lazy
  • There’s much more to web sites than performance. How about SEO? Are you sure that an automatic reorganization of your html source is SEO friendly? Maybe mod_pagespeed is harmless in 99% of the cases, but still TAKE A DAMN LOOK.
  • mod_pagespeed can be a very nice tool supporting development, though! You can use it to check out possible optimizations, opportunities that you might have missed. Use it as some kind of HTML+CSS template generator that transforms your first-run code to something possibly more optimized which you can alter by hand.

So as a summary, I’m sure mod_pagespeed can be a very nice tool in development mode to spot possible optimization opportunities, and also for large static-html CMS, etc. providers so that big chunk of unoptimized and messy static html pile gets a major performance upgrade, but I’d encourage every web developer to do these optimizations by hand or semi-automatically.

  • Paco

    Of coursing, knowing what to do and why you do it will give better result than installing a tool. Even when you know what to do, installing this tool will do no harm to some of the websites you have to support, but will give some performance benefit to the users. Sometimes, actively doing development to boost the performance doesn’t pay of, or the customer does not have the money right now. In that case, installing this tool, will probably more beneficial than doing nothing.

    I do also advice every developer to get the knowledge for web-optimization. From my personal experience, I can tell everyone that you will have a feeling of satisfaction when you know how it works. Before that, it will be fine to use a tool and later look at the “number” of yslow or page-speed. Once you have the high “numbers”, it will still be worth the effort to go on and try to better than you already are.

  • http://www.muhuk.com Atamert Ölçgen

    Very promising project. Thanks for recommending it! ;)

    Seriously; it looks like a great addition to our stack.

    I understand your concerns but web page optimization doesn’t necessarily break SEO and developers are supposed to **be informed**. OTOH doing these optimizations (which you seem to be activating explicitly) on the fly is priceless.

    A spriting filter would be a great addition though.

    Again, thanks for sharing. Take care!

  • http://townend.co Townend

    I gave it a go and found it only really improved performance on badly written pages: http://townend.co/blog/google-pagespeed/

  • http://www.interactone.com Thomas

    I have installed the mod_pagespeed to one of our servers and am VERY pleased with the results. One of our clients has a large wordpress site and even with best practices implemented was taking to long to load. This mod literally off seconds and the site is loading like a champ. I want to Install it on my other servers; however, there are many legacy sites running PHP4 and http 2.0 on them. Does anyone know if this mod would effect them adversely? Appreciate the input and good post!

    • http://www.iamnolegend.com ochronus

      Thanks for the real-life feedback, much appreciated!

    • http://www.iamnolegend.com ochronus

      I don’t think mod_pagespeed depends on the php version as it optimizes the html/css/etc. and it does not matter if the generator is php, ruby, python, shell script or even static files.

  • http://wp-performance.com WordPress Performance

    I agree that developers should already be implementing “best practices” and that this thing will do more harm than good.

    I plan on doing some tests on it soon. Hoping to compare before and after results on a WordPress installation with no caching and one optimized with W3 Total Cache.

Previous post:

Next post: