How does mod_pagespeed speed up web-sites?
mod_pagespeed ships with a set of core filters designed to safely optimize the content of your site without affecting the look or behavior of your site. In addition, it provides a number of more advanced filters which can be turned on by the site owner to gain higher performance improvements.
mod_pagespeed can be deployed and customized for individual web sites, as well as being used by large hosting providers and CDN’s to help their users improve performance of their sites, lower the latency of their pages, and decrease bandwidth usage.
wget wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.rpm rpm -U rpm -U mod-pagespeed-stable_current_i386.rpm
see here: http://linuxdrops.com/speed-up-apache-using-mod_pagespeed-module-from-google-on-centos-rhel-fedora-debian-ubuntu/
Apache Virtual Host Configuration
Jeremy Edgell provides the following Drupal 7 oriented virtual host configuration which can be tailored to local requirements:
Mod_Pagespeed Accelerator Configuration
Varnish/Nginx Caches use cache headers to improve performance and these are modified by default by mod_pagespeed. In order to allow these accelerators to cache the mod_pagespeed generated files the following configuration option should be included in the virtual host configuration
<IfModule pagespeed_module> ModPagespeedModifyCachingHeaders off </IfModule>
Preserving HTML caching headers
From the project website: “… By default, mod_pagespeed serves all HTML with Cache-Control: no-cache, max-age=0 because the transformations made to the page may not be cacheable for extended periods of time.
If you want to force mod_pagespeed to leave the original HTML caching headers you can add:
Note: We do not suggest you turn this option off. It breaks mod_pagespeed’s caching assumptions and can lead to unoptimized HTML being served from a proxy caches set up in front of the server. If you do turn it off, we suggest that you do not set long caching headers to HTML or users may receive stale or unoptimized content. …”
To disable mod_pagespeed for a specific virtual host include the following directive in the virtual host configuration:
<IfModule pagespeed_module> ModPagespeed off </IfModule>