[Solved] Cloudflare not caching the landing page?

pagerules
caching

#1

Hi there,

I have successfully setup Cloudflare except for that one nasty problem.

So my origin server is sending these Cache-Control headers:

public, max-age=300, stale-while-revalidate=86400, stale-if-error=259200

The PageRule for www.domain.com/* is set to:

  • Cache Level: Cache Everything
  • IP Geolocation Header: On
  • Automatic HTTPS Rewrites: On
  • Bypass Cache on Cookie: auth_key
  • Origin Cache Control: On

When I request my page with curl, CF-Cache-Status is not set and the page is not in Cache.

WEIRDLY, if I request any sub page, the origin returns the SAME Cache-Control header and voila, Cloudflare is caching the page. Just not the start page.

Here is the curl command I use to test my responses:

curl -vso /dev/null https://www.domain.com/

curl -vso /dev/null https://www.domain.com/page/1

What is going wrong? How do I debug this?
How can I rely on Cloudflare caching my stuff properly?

I mean, I am running a high traffic website there. If the landingpage cache falls flat, my servers are going to be hit with too much traffic.

Kind regards,

Lukas Rieder


#2

I fixed it… I had a page rule on top, that was causing all subsequent page rules to stop.

*.domain.com/

I did not know that Page Rules stop at the first match.

I removed that rule and copied its settings to each page rule down the line, and now it works again.


#3

This topic was automatically closed after 31 days. New replies are no longer allowed.