How to set the default Edge Cache TTL

Is it possible to set the value of Edge Cache TTL just like Browser Cache TTL. There is an option under Caching for Browser Cache TTL, but nothing for Edge Cache TTL.

I’d like to know if there’s an official doc, which tells the default value of it and how to change it.

Does set a page rule for all resources work? Will it change other default behavior of Cloudflare if I just set Edge Cache TTL? Will it stop caching?

I don’t get why there is no option for it…
Thank you guys!

1 Like

see https://developers.cloudflare.com/cache/about/edge-browser-cache-ttl/

and https://developers.cloudflare.com/cache/how-to/configure-cache-status-code/

Edge TTL

By default, Cloudflare caches certain HTTP response codes with the following Edge Cache TTL when a cache-control directive or expires response header are not present.

HTTP status code Default TTL
200, 206, 301 120m
302, 303 20m
404, 410 3m
403 0s
500, 502, 503, 504 0s
1 Like

What if my origin doesn’t have these headers? What is the default Edge Cache TTL and how can I change it at the website level?

1 Like

See my previous reply. But if you want finer grain control use Cloudflare-cdn-cache-control and/or cdn-cache-control headers at origin side https://developers.cloudflare.com/cache/about/cdn-cache-control/

Blog post https://blog.cloudflare.com/cdn-cache-control/

Thank you so much! Got it!

1 Like

Hi, this questions just come across my mind.

If I set Edge Cache TTL in a Page Rule, will it apply to all response status code for GET and HEAD methods or just 200 for Get and HEAD methods?

Because you know, even by default not all response status get cached, except for the following:
https://developers.cloudflare.com/cache/how-to/configure-cache-status-code/

From what I experience, only those status codes regardless of HEAD or GET. You can easily test this with curl on a server/Linux system or via HTTP Header Checker - Check HTTP Response Headers With curl | KeyCDN Tools

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.