Google released an open source Apache module to simplify the optimization of your content. The module, mod_pagespeed, will do all sorts of magic like minify your JS/CSS and optimize images, and a handful of other optimizations that seem (from limited testing) to improve your servers performance considerably.
First see how your site is doing right now, when you are done with the mod_pagespeed installation you can do another test to see if you have improved. Go to https://developers.google.com/speed/pagespeed/insights and check your score and remember it!
So if you want to install mod_pagespeed, follow this procedure (64-bit):
yum install at
We have to install it with dependency check disabled, because with DirectAdmin httpd is installed from source:
rpm -i --nodeps mod-pagespeed-stable_current_x86_64.rpm
Now we have to edit some files.
Open file: /etc/httpd/conf/extra/httpd-includes.conf and add this line:
#Google PageSpeed Module
Open file: /etc/httpd/conf/httpd.conf and remove this line or comment it:
If you’d like to change the options for PageSpeed, it’s configuration file is located in /etc/httpd/conf.d/pagespeed.conf.
Once everything is set, we’ll need to restart Apache and test to see if the module loaded properly:
service httpd restart
apachectl -t -D DUMP_MODULES
Check if you see “pagespeed_module (shared)” loaded.
Mod Pagespeed is loaded
Mod_Pagespeed is loaded
Now check if your site has indeed speeded up.
You should also check any .htaccess files you may use and remove any instances of ‘setoutputfilter’ as this will probably override what mod_pagespeed is doing.
There you have it! Load up a copy of FireFox with the PageSpeed installed and check out how your score has improved. In my case, with all other caching disabled, I went from a score of 67 to an 84. Not a bad improvement if you ask me!