Vercel catching problem
I encountered a problem this week while using Next.js version 13.4.1 and deploying my project on Vercel. When I checked how my project looked after deployment, I realized it wasn’t functioning properly. Initially, the main data fetched correctly on the first render, and even subsequent PUT requests to the backend worked fine, updating the data in the database. However, the issue arose when I attempted to fetch the updated data again — it kept returning the previous data instead of the new changes.
Get Reviterif’s stories in your inbox
Join Medium for free to get updates from this writer.
To address this problem, I started researching and attempting various solutions. I also consulted some colleagues for their insights. After investigating, I reached the conclusion that Vercel’s cache configuration was causing the issue. It seemed that the cache was preventing me from fetching the updated data, and I was consistently receiving a 304 status code, indicating that the cached version was being served instead. Despite trying to disable all the configurations both in Vercel and my Next.js project, I was unable to resolve the problem.
Due to time constraints and the need to continue working on my project, I decided to create a separate backend using Node.js and Express. Thankfully, this workaround allowed my project to function correctly. Now, everything is working as intended. If anyone reading this post happens to know the answer to this problem, I would greatly appreciate your insights.





