Skip to content

Selah.

Pause, and calmly think on that.

Menu
  • About
  • Free Gift
  • Highlights
  • The New Covenant
  • Thoughts
    • Personal Thoughts
    • Famous Thoughts
    • Random Thoughts
Menu

How to Install mod_pagespeed on CentOS

Posted on August 2, 2014August 4, 2014 by Matt

I was introduced to Google’s mod_pagespeed at my current place of employment. I dismissed it at first until I was tasked with adding it to one of our existing web apps that didn’t have it yet. Wow. KeepAlive + mod_pagespeed is fantastic. I know KeepAlive is old but it’s still off by default in Apache’s HTTPd config and, all by itself, it gives you a 3x savings in some cases I’ve tried. That, and mod_pagespeed brings you stuff like auto-bundling certain css and javascript into a single request, minifying javascript files and inline javascript, compressing images, generating optimized/rescaled images based on IMG tag width/height, etc. and it goes on. It’s a brilliant “best of breed” (forgive me for saying that!) compilation of all the best web performance techniques. Here’s how to install it…

This is really basic. It’s almost plug’n’play. Go to the mod_pagespeed download page and grab the latest stable version package. Then run `rpm -i mod-pagespeed-stable_current_x86_64.rpm` to install it. It will install a yum repository and all the files and conf needed for mod_pagespeed itself. Then run `service httpd graceful` to restart Apache HTTPd.

Now, open your browser and, before you do anything, open the network console. Then visit one your web pages. The first request will look normal. Pagespeed is analyzing the request the first time. This’ll happen every time you restart httpd I believe.

One last thing. When developing you’ll often want to clear Pagespeed’s cache of files or else your changed files won’t appear for you. Here’s how: run `touch /var/cache/pagespeed/cache.flush`.

By the way, one thing pagespeed allows is for developers, testers and the production environment to have the full, unminified versions of css and javascript meaning developers can turn off pagespeed and, when errors occur in the browser console, you can easily go to the line of the file with the error.

Good luck! Hope you love the change as much as I did!

  • Share
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to email a link to a friend (Opens in new window) Email

CommentCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • The Seven Wonders of the Web
  • Universal Bisection Search Online Spreadsheet Tool
  • Thoughts From Reconstruction by M.J. Gallant – Notes
  • Thoughts From Reconstruction by M.J. Gallant – About the Author
  • Thoughts From Reconstruction by M.J. Gallant – One More Thing

bible book canada centos christ christian christmas church creation evolution faith family game genesis God gog good google government heart iracing jesus life linux lord love matthew music pc poem poetry quote racing romantical salvation science sim sin steam truth update video windows word YouTube

Log in
© 2025 Selah. | Powered by Superbs Personal Blog theme