Select Page

Need for Speed? mod_pagespeed from Google

mod_pagespeed is the latest addition to our family of products, performing on-the-fly optimization in the Apache™ 2 HTTP Server. It provides webmasters and web developers that manage their Apache 2 configuration with technology that applies Page Speed performance best practices automatically. Webmasters can get the benefits of the optimizations without having to manually going back and fixing the performance issues that Page Speed detects.

This solution is valid if you do not want to carefully optimize your site, and it come for now at huge initial CPU costs till the cache is filled up. The load on my server has proven to be unacceptable (for me) and I was forced to switch it off. But it may work on your server depending on the page size, number of visitors. Authors are working hard and communicating a lot on the official mailing list to reduce that load and improve the code in the coming weeks

If you trust me, you can download the library module for Apache 2.2


Check before installing the MD5 keys of this file

# md5sum -b 187995e3623a222ec5b54c331ee7ffaa *

If it matches, drop it into your Apache library folder /usr/lib64/apache2/

Build Apache module mod_pagespeed yourself

On my OpenSuSE system, I was forced to install first

zypper in gcc-c++

Then read

you should get after a successful build

  • ./out/Release/
  • ./out/Release/install/common/pagespeed.conf

Install the module library

cp ./out/Release/  /usr/lib64/apache2/


After installing mod_pagespeed, it can be customized and configured by editing the Apache configuration file


so you can run

# cp ./out/Release/install/common/pagespeed.conf /etc/apache2/conf.d/pagespeed.conf

Create some directories

# mkdir /var/mod_pagespeed/ # mkdir /var/mod_pagespeed/cache/ # mkdir /var/mod_pagespeed/files

Has to be writtable by apache

chown -R wwwrun:www /var/mod_pagespeed/ 

and finally restart apache

 apache2ctl restart

There is a lot of available settings that are all well explained in this page

Here is my /etc/apache2/conf.d/pagespeed.conf stripped of all comments as an example:

LoadModule pagespeed_module /usr/lib64/apache2/    
ModPagespeed on      
ModPagespeedUrlPrefix  ""     
ModPagespeedFileCachePath "/var/mod_pagespeed/cache/"     
ModPagespeedGeneratedFilePrefix "/var/mod_pagespeed/files/"     
ModPagespeedRewriteLevel CoreFilters     
ModPagespeedEnableFilters collapse_whitespace     
ModPagespeedEnableFilters extend_cache     
ModPagespeedEnableFilters combine_css     
ModPagespeedEnableFilters rewrite_css     
ModPagespeedEnableFilters rewrite_javascript     
ModPagespeedEnableFilters rewrite_images     
ModPagespeedEnableFilters remove_comments

# This page lets you view statistics about the mod_pagespeed module.
Order allow,deny         
# You may insert other "Allow from" lines to add hosts you want to      
# allow to look at generated statistics.  Another possibility is       
# to comment out the "Order" and "Allow" options from the config        
# file, to allow any client that can reach your server to examine        
# statistics.  This might be appropriate in an experimental setup or       
# if the Apache server is protected by a reverse proxy that will         
# filter URLs in some fashion.         
Allow from localhost         
SetHandler mod_pagespeed_statistics      


You may be forced to remove mod_deflate

You can disable mod_pagespeed by adding in the url  ?mod_page_speed=0

Some mod_pagespeed filters


0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments


Would love your thoughts, please comment.x