Next.js Discord

Discord Forum

How will unstable cache behave in this situation?

Unanswered
Large oak-apple gall posted this in #help-forum
Open in Discord
Large oak-apple gallOP
I have static page that uses unstable cache to get data.

Workflow:
1. Category id is passed as page props
2. Page goes to api and fetches list of item ids, not cached
3. List of ids is passed into unstable cache, cache tags are used
4. Inside unstable cache goes to api and gets data for all items, returns data
5. Renders page with loaded items data

Scenario: one of cache tags triggers revalidation. What happens to page then?
Does it go all 5 steps again?
Or does it start from step 4 with same list of ids as input and only fetches new data for them?

In other words, if category gets new item, will it be included into rerendered page after cache invalidation?

0 Replies