Next.js Discord

Discord Forum

How to to have an updated data in CMS rendered on the page using SSR components, with caching?

Unanswered
Nebelung posted this in #help-forum
Open in Discord
NebelungOP
1. I want to fetch projects from CMS (Sanity) and have the most up to date data on my page.
2. I also want to have these projects cached (lots of images inside projects) and rendered on the server (I'm using SSR components).

Question: What should I use?
Also, is revalidateTag working with SSR?

I've tried:
I've tried adding api route to revalidate tags (just as Sanity suggests doing here: https://github.com/sanity-io/next-sanity#tag-based-revalidation-webhook) but there seems to be some cache issue with Next. It receives 200 status POST call but displays data from the some old build of the project.
Happy to share my project repo.

0 Replies