Caching issue with Next.js on Vercel
Unanswered
Arboreal ant posted this in #help-forum
Arboreal antOP
Hi everyone,
I'm encountering a caching issue with Next.js and I could use some help.
I'm making a server-side request to fetch the Unix time of an episode's release date, which I then convert into a timestamp.
The problem is: this Unix value seems to be stuck in cache only on Vercel production.
When running on Vercel in development mode, or when hosting the app on another local server, I don't experience the issue.
What's strange is that in the same request, the other data seems to update correctly, only this Unix timestamp remains cached.
I'm using the same fetching and caching system everywhere in my project, but this specific case is the only one where the cache doesn't seem to refresh.
At the moment, the only workaround I found is to manually clear Vercel's cache, which obviously isn't ideal.
Any idea why this could happen and how to properly fix it?
Thanks a lot in advance!
I'm encountering a caching issue with Next.js and I could use some help.
I'm making a server-side request to fetch the Unix time of an episode's release date, which I then convert into a timestamp.
The problem is: this Unix value seems to be stuck in cache only on Vercel production.
When running on Vercel in development mode, or when hosting the app on another local server, I don't experience the issue.
What's strange is that in the same request, the other data seems to update correctly, only this Unix timestamp remains cached.
I'm using the same fetching and caching system everywhere in my project, but this specific case is the only one where the cache doesn't seem to refresh.
At the moment, the only workaround I found is to manually clear Vercel's cache, which obviously isn't ideal.
Any idea why this could happen and how to properly fix it?
Thanks a lot in advance!
1 Reply
Arboreal antOP
Oh, I forgot to mention:
I'm using fetch to make the server-side request.
Thanks again for your help!
I'm using fetch to make the server-side request.
Thanks again for your help!