Increase web server performance with Google mod_pagespeed


The Google mod_pagespeed Apache 2.2.x module is a perfect fit for our cloud VPS users because our LAMP images are running Apache 2.2.x or greater (includes Plesk and CPanel). If you have image-heavy or large html pages with many css definitions or javascript, this module can help. Installation is simple, just download mod_pagespeed to your server and install it using rpm or dpkg. Then edit the pagespeed.conf file and add your configuration options and restart Apache.

Following is an example of how to install this module on a Netsonic CentOS cloud server after SSHing into your server and becoming the root user -

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm
rpm -ivh https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm
nano /etc/httpd/conf.d/pagespeed.conf

(edit the config file - search for the "ModPagespeedEnableFilters" section and add the following)
ModPagespeedEnableFilters make_google_analytics_async,extend_cache,collapse_whitespace,rewrite_images,rewrite_javascript,rewrite_css

search for the "ModPagespeedImgMaxRewritesAtOnce" section and add the following)
ModPagespeedImgMaxRewritesAtOnce 8

..save the file and restart Apache via -
/etc/rc.d/init.d/httpd restart

Please note: this module will not cache SSL-based content so SSL secured (https) sites will not benefit from this module.

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 filters 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.

(Ref: http://code.google.com/speed/page-speed/docs/rules_intro.html)