Next.js Discord

Discord Forum

Sync ServerCache and ClientCache

Unanswered
Persian posted this in #help-forum
Open in Discord
PersianOP
Is there a good way to have a synced cache between next-client and next-server files?

I am trying to find something valid to go after, but it all seems to outdated information.

3 Replies

Pacific sand lance
i'd say websockets, but since nextjs doesnt support them (still) you can use streams/sse
you can try https://www.npmjs.com/package/@upstash/realtime to emit cache stuff to client immediately
still you'd need to write cache logic