ERROR: (using Next.js, TanstackQuery, Axios) Server returns Old data, even after deleting content from the database. Fresh data is only fetched after rebuilding vercel deployment. #2
Labels
bug
Something isn't working
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
The code seems to work correctly in local development server, but after deploying on vercel it appears that the data is cached and the same data is returned on every request. Even after deleting/adding some data to mongodb the data does not update.
I have tried disabling all caching methods on fetching, added
queryCache.clear()
from TanstackQuery and disabled 'Vercel Data Cache', it did not resolve the issue.The fresh data is fetched only after redeplying the site on vercel.
The text was updated successfully, but these errors were encountered: