System Design · Middle · Question 46 of 75
How do you update the client cache after a mutation so the user sees the changes?
- ✓Correct answer: Invalidate queries or put the response into the cache
- 2Reload the page after every mutation
- 3Wait until the cache expires on a timer
Explanation
Key-based invalidation (invalidateQueries, RTK Query tags) refetches fresh data; if the server returned the updated object, it's written into the cache directly without an extra request. On the Next.js server the equivalent is updateTag/revalidatePath.