Adminbuntu

Everything for the Ubuntu Server Administrator

User Tools

Site Tools


Sidebar

Server Administration


Server Applications


At the Command Line


Elsewhere


Copyright 2013 Applied Conscious Technologies, LLC

Terms of Agreement

Contact


submit to reddit

google_pagespeed_module_on_apache

Apache | Website Optimization

Google PageSpeed Apache Module on Ubuntu Server

PageSpeed speeds up your website and reduces page load time. The PageSpeed Apache module automatically applies web performance best practices to pages and assets like CSS, JavaScript and images, without requiring site modification.

project page: https://developers.google.com/speed/pagespeed/module


Installation

Determine Whether 32-bit or 64-bit Ubuntu Server is Installed

if [[ `uname -a` == *_64* ]] ; then echo '64-bit' ; else echo '32-bit' ; fi

Download the PageSpeed Apache Module

  • Look on the right side of the page, under Latest Stable Version and right-click on either the 32-bit or 64-bit .deb package (based on whether you are running 32-bit or 64-bit Ubuntu Server. Select Copy Link Address to get the download link in your clipboard.
  • In your server's terminal use wget to download the module.

This this example, the link for the 32-bit .deb file is https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.deb:

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.deb

Install the PageSpeed Apache Module

sudo dpkg -i mod-pagespeed-*.deb
sudo apt-get -f install
sudo service apache2 restart

Test Installation

You can verify that the PageSpeed module is installed and enabled with:

if [[ -a '/etc/apache2/mods-enabled/pagespeed.conf' ]] ; then echo 'pagespeed is enabled' ; else echo 'pagespeed is not enabled' ; fi

Flushing PageSpeed Server-Side Cache

When developing web pages with PageSpeed enabled, it is sometimes necessary to flush the server's PageSpeed cache to get the system to reload CSS or JavaScript files that have been updated before the cache lifetime expires.

To do this, touch the file cache.flush:

sudo touch /var/cache/mod_pagespeed/cache.flush

google_pagespeed_module_on_apache.txt · Last modified: 2015/05/31 21:20 (external edit)