Page rules bug: Browser Cache TTL sends 10 years instead of 30 minutes


Hello All!

We are now testing if we can use Cloudflare for our new project, DuzyTV and I think we see page rules bug.

Browser Cache TTL sends users 10 years instead of 30 minutes.

What we need: cache static html files for a while on Cloudflare side ( domain): we set TTL to 10 years, but clear the cache on Cloudflare side using API when we need to update something. But we need to have 0-30 minutes TTL to send to our users’ browsers.


We have defined page rule:*.html
Browser Cache TTL: 30 minutes, Cache Level: Cache Everything

We also tried to add “Edge Cache TTL: a month” with same result: Cloudflare sends 10 years TTL to users.

Please assist.


That sure looks like 10 years. If it’s a bug, open a Support Ticket:
Login to Cloudflare and then contact Cloudflare Support


I’m seeing 30 minutes…

< cf-cache-status: HIT
cf-cache-status: HIT
< cache-control: public, max-age=1800


I should have taken a screenshot. Something that looked cache-related calculated out to 10 years.


We updated our server configuration to set expires to 1800 seconds.
The bug is opened with screenshots of the problem.

cscharff, I you need, I can easily create another simple demo server to demonstrate the problem.


Sure if you don’t mind. I’m technically not in support so my time to troubleshoot is a bit sporadic, but happy to take a look.


I’ve setup a very simple test to demonstrate the problem: - page that sets cache-control
max-age and related headers to 315360000 - page that is reverse-proxied using Cloudflare with page rules “Browser Cache TTL: 30 minutes, Cache Level: Cache Everything”

Thank you for your help!


Can you try setting origin cache control as off and see if that makes a difference?

1 Like

Sure, if I set origin cache control off or less than 30 minutes, it works fine: gets overwritten with 30 minutes.
This bug only appears for any origin values > 30 minutes.


Ah so just had a discussion internally… with that setting we will return either the setting you have (30 minutes) or the value from the origin, whichever is higher. So in this case since you’re sending a max-age of 10 years we’re returning that. I believe you could work around this by sending s-max-age of 10 years and then either a shorter max-age or (I assume without an explicit max age we’d use your 30 mins).


Thank you a lot, I’ve googled about s-max-age, and found the following article:

Thank you, this is exactly our case where we need to ask Cloudflare to cache page for a very long period of time (as soon as they change extremely rare in our case), but want to prevent local browser caching problems if/when we need change something.

Anyway I think current behavior looks not straightforward and definitely looks like bug or at least should be documented.

Thanks again, will play with it tomorrow!

closed #12

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