I’ve tried many different headers and can’t seem to crack the code here regarding cacheing.
I run a script to warm up 500 of my most important URLs. Afterwards, all urls are added to the edge cache. I can confirm with consistent HITs in the network headers.
If I check back an hour or so later, all URLs have been dropped from the cache as they are all MISS.
I’m attempting to store them for just over 24 hours with my header.
Hmm, your header looks set up for about 25 hours and after reading through the documentation (Caching on Vercel's Edge Network) the limits also seem in line.
Can we make sure that the cache is not considering the URLs as “stale” and evicting them? This might happen if your URLs are not being accessed frequently after warming up.
Also, can we check that the response headers on your site are being set only once and are not being modified by any middleware, or proxy settings?
Also, I’m not sure about the use case but if there is a static behaviour is a use case maybe you can try Incremental Static Regeneration (ISR) but then again, since I’m not aware of your use case, it can only be helpful upon your decision
My problem is likely that my site is quite new. I had the idea of warming up important pages so that new visitors would have a quick loading experience.
Is that just not possible with Vercel’s edge cache? Cloudflare has a feature called Cache Reserve, specifically designed to retain cached content persistently for up to a year. Even little visited pages can stay in cache.
Is there a way to make that work with Vercel? I would much prefer working with Vercel as the integration with Astro works quite well.