Cache Everything only works for a few minutes

I have a static web site. Since nothing changes and I want to minimize traffic to the server, I set up a Cache Everything page rule. But it doesn’t do anything. I can tell because I am getting multiple requests in Apache’s access log file from Cloudflare IPs for the same file within a few minutes of each other. Testing it with Cloudflare’s utility will usually start with a miss but then show a hit if I request the file immediately again. So it must be caching for a few minutes anyway.

I only have 2 page rules. The first redirects traffic from no www to www. The second is a Cache everything page rule with an Edge Cache TTL of 1 month. I also added a Cache-Control header that says public, s-maxage=5270400 to Apache’s config, and verified that it’s in all HTTP responses but that has no effect.

I’m not sure what else to try.

Also see Better cache hit rate in paid subscriptions? - #2 by Judge

Cloudflare is not a single cache, but dozens of caches distributed around the world. Each cache could have its own copy of a URL, and could generate a separate request to the back-end server if there is a cache miss.

1 Like

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