#Server state management in NextJS
1 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
In my experience, data that must be only "shown" in the client, and don't demand updates (ex: polling, retries), should be reserved to the server.
By RSC's model, anything that can be pre-fetched and cached, must be
I would reach to RQ if, for example, my data can be updated by an external system
I think it's always worth remembering RSC is a mean to provide availability on your data being already rendered
Sometimes RSC is good to just provide initial data to your UI, then you can update it with RQ or any stale while revalidate solutions.
Sometimes, depending of the user demographic and application I'm devving, I even just use RQ and forget completely about the server (greatly simplifies architecture)
If you're making a blog, and you're using a CMS, then it doesn't make sense to fetch much from the client.
With RSC + Next.js caching, how do you manage server state, client caching, prefetching, optimistic updates, and invalidation—and when do you still reach for React Query/SWR/Apollo?
Nextjs Caching is only majority a server-side caching solution.
You still need RQ/SWR/Apollo something for optimistic updates/global store/client-side fetching (like async dropdown or async <select>) that requires changing client-side store.