Cache API Expires After 120m
Hi guys,
I have a worker that fetch from JSON from origin and supposed to cache it "permanently" in edge. Below is the sample code:
Cam confirm that the above code is cached in edge with
CF-Cache-Status
and Age
of the subsequence response. The "Browser Cache TTL" of the zone is also configured to "Respect Existing Headers" and that the Cache-Control
is the overwritten one with 1 year TTL in the worker.
However, the cache will get deleted from edge as soon as it hit 7.2k Age, or 120m, which is the default edge TTL for code 200.
Can I check if this is a limitation with Cache API or is there any other config that I missed out?
Thank you.3 Replies
The Edge Cache works on a best effort system. You are never guaranteed to have a value cached as long as you want it, especially not as long as a year. I wouldn’t expect an asset to last more than a day(unless it is very heavily requested).
Thank you. Thought that it was something wrong with my setup.
So caching with cache api clears unused caches automatically? I thought I would have to manually track the requests