How to test if Google Pagespeed module is working correctly? - Ask Ubuntu


say installs google pagespped module as described here:

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

how can test if it's working? didn't see test command in linked documentation above. there "test files" unclear me documentation how these used.

you can on command line running curl against server -i option print headers , -s option prevent connection info being displayed. send grep see if there x-mod-pagespeed header.

curl -is http://ip.ad.dr.es/ | grep x-mod-pagespeed 

if want make easier use use following shell script takes server first parameter , string match in output second.

#!/bin/bash  headers=$(curl -is $1) return=1  echo "fetched these headers $1": echo "$headers"  if [[ $( echo "$headers" | grep $2) ]]     echo "$1 returns $2 header"     return=0 else     echo "$2 header not found"     return=1 fi  exit $return 

you can run

script http://server/ x-mod-pagespeed 

adjust return values suit if need specific responses , remove echo statements if making output harder read.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User