Apache module ‘mod_pagespeed’

mod_pagespeed Overview.

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.

Three steps to mod_pagespeed


mod_pagespeed is now available as a downloadable binary for i386 and x86-64bit systems, and is tested with two flavors of Linux: CentOS and Ubuntu. The developer may try to use them with other Debian-based and RPM-based Linux distributions.

mod_pagespeed currently only supports Apache 2.2. There are no plans to support earlier versions of Apache, but patches are welcome.

Serve your web pages with Apache and mod_pagespeed

Follow the instructions provided to configure mod_pagespeed with Apache 2.2. In addition, configure caching and compression to get the maximum benefit out of your HTTP Server.

Get familiar with the configuration. There are several filters provided as part of this module, including some exciting experimental features such as CSS outlining. With some experimentation, you can fine-tune the configuration to get the maximum benefit in terms of page performance.

Learn more about Web Performance

The field of web performance is a complex space. While there are many interesting books, blog posts and discussion forums, we provide here a set of pages related to web performance and organize it in terms of contribution to the speed of a web page, whether by serving less bytes -through better compression or caching-, minimizing round-trips and optimizing the order of resource download for the browser.

This documentation is by no means complete or final. We update it regularly with new rules and updates to how the rules apply to modern browsers.