Closed hunghvu closed 9 months ago
Added these rules. We will monitor for a few days to observe the behavior.
After further investigation here is the observed behavior.
The caching issue is due to the way Next.js sets headers. If Cloudflare ignores the headers, then it can enforce caching. Let's push this issue back to milestone v1.2. For now, a workaround in Cloudflare is sufficient. We will resolve the root cause later on.
Relates to #58, #77, #81.
Since overriding the header, the cache ratio is now at a good spot.
The cache has been working well since our fixes during v1.1 development. Two main things were implemented.
It is important that the status code TTL of Edge must be specified, or else the cache rule will not work.
This issue can be closed now.
It seems the page bypass Cloudflare cache, resulting in a very low cache hit.
This might be due to unexpected Next.js cache header setting, need to investigate.
This might be due to the default behavior of Cloudflare, and the link below is worth looking into:
https://community.cloudflare.com/t/doesnt-seem-to-be-caching/502969/5
https://developers.cloudflare.com/cache/how-to/edge-browser-cache-ttl/create-page-rules/#cache-everything