I'm NOT looking to bypass cache on every request. I want my Nextjs app to fetch new data when cache
I'm NOT looking to bypass cache on every request. I want my Nextjs app to fetch new data when cache has been invalidated (via
Like I said, it's kind of working as expected. But it's not 100% reliable. Old data is appearing in various places (locations/browsers) then getting stuck. So a timestamp won't fix this cos it might make nextjs fetch new data every-time. I don't want that.
I've been using
The site in question is a news website. Think of it like a blog. You have an index (home) with post titles/summaries, then you have the post pages. What's happening is: a new post is added, I programmatically call
It's almost like Cloudflare worker/pages aren't spreading data updates across the rays (datacenter's). As though each ray stores it's own instance of
Sorry to ramble, just hoping I've missed something obvious that's maybe Cloudflare specific.
revalidateTag) and after a stale request has been made. Then, after a fetch, it should cache again. This is standard nextjs functionality and has worked me on Vercel.Like I said, it's kind of working as expected. But it's not 100% reliable. Old data is appearing in various places (locations/browsers) then getting stuck. So a timestamp won't fix this cos it might make nextjs fetch new data every-time. I don't want that.
I've been using
revalidateTag for years on Vercel. It works great and is a modular way to manage data cache.The site in question is a news website. Think of it like a blog. You have an index (home) with post titles/summaries, then you have the post pages. What's happening is: a new post is added, I programmatically call
revalidateTag with relevant tags. I then view the page on my browser and refresh it shows the latest post titles on the home page and correct post titles. However, browsers in other locations show old data (even after refresh). And the old data is staying for days. My fetch revalidate is only set to 300 seconds (5mins).It's almost like Cloudflare worker/pages aren't spreading data updates across the rays (datacenter's). As though each ray stores it's own instance of
.next cache. Surely that's not right? Even if it were right, you'd need a way to invalidate cache across all of it, on demand. But I can't find that anywhere.Sorry to ramble, just hoping I've missed something obvious that's maybe Cloudflare specific.
