I have the problem with Nuxt 3 and Vercel, that I want to exclude some paths from caching. I tried out different Cache control headers, but somehow every request get’s cached.
Here are my headers: "Cache-Control": "private, no-cache, no-store, must-revalidate", . In the screenshot, you can see that we always get a HIT and the age is increasing with every page refresh. Thus, my headers are ignored.
Which headers shall I use to exclude those pages from the edge cache?
Hey Alexander, the cache settings can be persistent sometimes and fail to show updates right away. In any case, we have a couple targeted cache control headers that you can use to ensure your settings take precedent over any defaults. Check out this doc for more details.
The headers are CDN-Cache-Control and Vercel-CDN-Cache-Control. They work the same way, just with a different priority. I think this should help solve your issue, but let me know if not!
Hi @alexba, is this happening on all routes or just the sitemap.xml?
Can you share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong.