Website gets HIT only on www and not on naked

caching

#1

Hi there.
I use curl to check if my website is reachable on the CF, and weirdly only the www. version gets HIT and non-www gets MISS all the time.

Is there is a way to set up that both works globally?

I have no page rule related to that and believe this can be fixed from DNS or global settings.

Thanks.


#2

On non-www i get this:

Cache-Control: public, max-age=31536000, no-cache


#3

Your origin is sending the no-cache directive and we’re respecting that. The www is sending a 301 redirect. It’s the 301 which is being cached, not the content.

  • If the Cache-Control header is set to “private”, “no-store”, “no-cache”, or “max-age=0”, or if there is a cookie in the response, then Cloudflare will not cache the resource.

#4

Thanks for the response! In my CF dashboard, i’ve set the Browser Cache Expiration to 1 month. Doesn’t this overwrite origin cache control?

Thanks.


#5

The Cache Expire TTL rule will overwrite origin cache control.

You can read about it here: