How to test if Google PageSpeed module is working correctly?

8,921

Solution 1

you can do this quickly on the command line by running curl against your server with the -I option which will just print the headers and the -s option to prevent the connection info from being displayed. Then we send it to grep to see if there is an X-Mod-Pagespeed header.

curl -Is http://IP.AD.DR.ES/ | grep X-Mod-Pagespeed

if you want to make this easier to use you could use the following shell script which takes a server as the first parameter and a string to match in the output as the second.

#!/bin/bash

HEADERS=$(curl -Is $1)
RETURN=1

echo "Fetched these headers from $1":
echo "$HEADERS"

if [[ $( echo "$HEADERS" | grep $2) ]]
then
    echo "$1 returns the $2 header"
    RETURN=0
else
    echo "$2 header not found"
    RETURN=1
fi

exit $RETURN

You can then run it as

script http://server/ X-Mod-Pagespeed

adjust the return values to suit if you need specific responses and remove the echo statements if they are making the output harder to read.

Solution 2

If all you want to do is test it, then you could use an online tools such as:

Type in your domain name or http address, and hit the "Check" button

If you want to test further:

  • open Chrome, and open the Developer Tools via menu under Options → More Tools → Developer Tools (Or just use the keyboard shortcut <CTRL> + <SHIFT> + I)
  • Try and load a web page on the server you just enabled PageSpeed on.

You should see a result like this:

Pagespeed

Information Source: https://moz.com/ugc/use-googles-pagespeed-module-to-dramatically-increase-the-speed-of-your-website

Share:
8,921

Related videos on Youtube

Gwyneth Llewelyn
Author by

Gwyneth Llewelyn

I'm just a virtual girl in a virtual world... Interested in exploring virtual worlds like Second Life and amateur developer of WordPress sites, themes, and plugins.

Updated on September 18, 2022

Comments

  • Gwyneth Llewelyn
    Gwyneth Llewelyn over 1 year

    Say someone installs Google PageSpeed module as described here:

    sudo touch /etc/default/mod-pagespeed
    sudo dpkg -i mod-pagespeed-*.deb
    sudo apt-get -f install
    

    How can you test if it's working? I didn't see any test command in the linked documentation above. There are some "test files" but it is unclear to me from this documentation how are these used.