In short, Google mod_pagespeed is a Apache HTTP server module that helps you optimize your web pages without changing a single lines of code in your web application. In this article I’ll demonstrate how to get the mod_pagespeed up and running.
Note: This article is written for CentOS environment, if you’re using other Linux distros, please find the installation steps here.
Run the following commands one-by-one
yum install httpd #if you haven't installed apache
yum install at #the "at" package is recommended by google
rpm -U mod-pagespeed-*.rpm
Now you have already installed mod_pagespeed in your apache server, restart the apache server to make it effective. However there’s some config you may wanna change, to edit the config file, run the following command:
The following is some of my preferred changes
# In my experience I have to enable this to make it work for Wordpress
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER application/xhtml+xml
# but these filters are where is "magic" happen, so you have to experiment on your own website
Reload Apache server config to make it effective
service httpd reload
You can find more filters in the PageSpeed official website.
PageSpeed Chrome Plugin
You can install the chrome plugin here, to evaluate the performance of your website.