Hey everyone,
I’m working with Astro on Vercel and using new Vercel’s tag-based cache invalidation feature (as described here: https://vercel.com/changelog/tag-based-cache-invalidation-now-available-for-all-responses).
In production, I’m tagging my responses and using those tags to cache and invalidate pages/data properly. This works great.
However, I’m now implementing a CMS preview mode, and I’m trying to find a clean way to bypass all caching entirely for preview requests, including:
-
Cache-Control headers
-
Cache tags (
x-vercel-cache-tag)
The goal is that when I hit a preview route, I always get fresh data from the CMS, regardless of any previously cached responses or tags. Then invalidate those tags when I publish from my CMS.
Is there an official or recommended way to bypass cache set by Cache-Control headers and cache tags?
Curious how others are handling CMS previews with tag-based caching on Vercel on other framework than Nextjs