May 3, 2013

f Comment

Why is Google PageSpeed Service Not Working?

Amazon If you just started using a CDN such as Cloudflare or Google PageSpeed Service you may come across some confusions. Rest assured this article will help you unravel the mysteries.

Question
I am using Google's PageSpeed Service as a CDN for my website but how come my origin web server log still shows HTTP requests when I go to my website? I am thoroughly confused.

To answer your questions walk through the things to check below. Let's assume your website is https://cppprogramming.chtoen.com/

Are you sure Google's PageSpeed Service is configured to cache your site's content?
At the time of the writing Google's PageSpeed Service only caches static resources. Per https://developers.google.com/speed/docs/pss/faq#cachewhat:

PageSpeed Service speeds up loading of your page by caching the cacheable parts of your page (amongst other techniques). This includes resources such as images, JavaScript and CSS.
So the bad thing is you cannot control what gets cached with Google's PageSpeed Service.

My website https://cppprogramming.chtoen.com/ uses Google's PageSpeed Service and I've verified that Google's PageSpeed Service caches pages that end in .html too.

Read my post on The Best Configurations for Google's PageSpeed Service for more details on setting up Google's PageSpeed Service for your website.

How long does Google's PageSpeed Service cache your site's content for?
Per https://developers.google.com/speed/docs/pss/faq#cachewhat Google's PageSpeed Service respects the cache control header of your original server.

It means you are in control of how long you want Google's PageSpeed Service to cache your webpages for.

To learn how to set up your web server to add the cache control header read my post on The Best Configurations for Google's PageSpeed Service.
How do you know if Google's PageSpeed Service is working?
Unfortunately Google hasn't released a way to examine the response HTTP header to know whether Google's PageSpeed Service uses its cache to respond to an HTTP request.

However if you see the following HTTP header it means Google's PageSpeed Service is involved in serving the request.

X-Page-Speed:89_1_go
The most straightforward way I can think of is simply monitor your web server's log as you hit your website. If you see nothing it means your request has been handled by Google's PageSpeed Service. Otherwise it means your web server handled the request.

If you set up everything correctly and hit the same webpage twice and still see request hitting your server, email Google. They listed their contact email in the PageSpeed Service approval email they sent you.

Does your URL have a query string or a URL parameter?
In other words does your look like http://www.mensfashionforless.com/?param=1&param2=abc? As of 2013/5/10 Google PSS caches URLs with query strings respectively. For example the following URL

http://www.mensfashionforless.com/?param=1
and the following URL

http://www.mensfashionforless.com/?param=2
are considered different URLs by Google and therefore cached as two different pages. Usually this is the desired behavior.

If you have any questions let me know and I will do my best to help you!
Please leave a comment here!
One Minute Information - by Michael Wen
ADVERTISING WITH US - Direct your advertising requests to Michael