Next.js Discord

Discord Forum

nextjs is caching sql responses

Unanswered
Catla posted this in #help-forum
Open in Discord
CatlaOP
I'm using @vercel/postgres in my nextjs app, and I find the sql responses are being heavily cached with some strange cache-busting behaviours (e.g removing the semicolon will bust the cache)

I believe this is because @vercel/postgres uses @neondatabase/serverless which uses fetch, and nextjs intercepts fetch globally to implement its data caching layer

I have some heavy interactions with the DB that I need to implement (eg. mutex) and unsure how I manage caching configuration in a way that will work with the postgres SDK - any tips?

0 Replies