2
votes

Im new to CDN, and i moved my Wordpress site to Google Cloud Platform GCE 2 days ago. I already have a Load Balancer with CDN enabled, but "Cache Hit Rate" is at 0% and hasn't moved.

My website is https://cryptstorm.com

I checked with this tool https://www.giftofspeed.com/cache-checker/ and it seems Cache-control and ETags are working properly but CDN doesnt seem to be working. I also checked here https://www.cdnplanet.com/tools/cdnfinder/#site:https://cryptstorm.com and most of the requests are being made directly to the site.

What am i doing wrong, and how can i have CDN working properly?

1

1 Answers

7
votes

After running the command "$ curl -sSL -D - https://cryptstorm.com -o /dev/null" it shows the following headers output:

> HTTP/2 200 date: Tue, 10 Jul 2018 07:46:15 GMT content-type:
> text/html; charset=UTF-8 set-cookie:
> __cfduid=db3de46de5278430e9a9c1ba1d14f642b1531208774; expires=Wed, 10-Jul-19 07:46:14 GMT; path=/; domain=.cryptstorm.com ; HttpOnly;
> Secure x-powered-by: PHP/7.0.30 x-cf-powered-by: WP Rocket 3.0.5 link:
> <https://cryptstorm.com/wp-json/>; rel="https://api.w.org/"
> x-frame-options: SAMEORIGIN x-mod-pagespeed: 1.9.32.14-0 vary:
> Accept-Encoding cache-control: max-age=0, no-cache via: 1.1 google
> alt-svc: clear expect-ct: max-age=604800,
> report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
> server: cloudflare cf-ray: 43816a5b1986a857-CDG

We can focus on the line:

"cache-control: max-age=0, no-cache"

This is telling as the cache isn't setup for the webpage https://cryptstorm.com, even giving a max age of 0 seconds. Try to modify this and check again.

In the documentation we can read the following:

" A response will not be cached if any of the following are true:

ยท It has a Cache-Control: no-store, no-cache, or private directive."

If this still didn't clear the issue to you I would recommend you to open a case with Google Cloud Support as they will have more information about how is CDN configured in your VPC and what can be wrong configured.