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.
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 http://www.programmingincpp.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:
So the bad thing is you cannot control what gets cached with Google's PageSpeed Service.
My website http://www.programmingincpp.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.
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¶m2=abc? As of 2013/5/10 Google PSS caches URLs with query strings respectively. For example the following URL
and the following URL
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!