The Edge Cache TTL setting in the Page Rules app of the Cloudflare dashboard controls how long the Cloudflare edge servers will cache a resource before going back to your origin web server for a fresh copy.
Sometimes cache headers are set on the server-side or by a CMS solution like Wordpress. If you choose to cache everything (Cache Level > Cache Everything setting in Page Rules), you can set the rule to respect existing headers. This tells our edge nodes to hold the item in the cache for the time specified by the origin web server. If no headers are specified at the origin server for the resource, our edge nodes will still cache the resource as long as that resource is frequently requested.
It is important to note that the Edge Cache TTL value isn't visible in response headers, but is an internal value recorded at the Cloudflare edge.
To change the Edge Cache TTL, choose a time from the drop-down menu. This is the re-fetch time for when Cloudflare checks the origin server for a new resource.
Cloudflare offers a range of edge cache TTLs based on customer plan:
||Minimum edge cache TTL
Common situations where you may choose to set a Cache Everything rule:
- You expect a large surge in traffic.
- You are under DDOS attack.
- You are not sure what the headers on WordPress or your server are set to.
- You are using WordPress and want to easily overwrite the default settings.