I'm experiencing issues with Apollo Client and the NextJS app router related to caching. Does anyone here have expertise with caching in this context?
The problem might be specific to NextJS, but I'm not entirely sure.
I have a query that fetches the contents of a cart. When users navigate to the /cart route, the data isn't cached (which is correct). However, if the page is refreshed, nested objects within the cart items are cached (not correct). I think this is a normalization cache of some sort, but cannot figure out how to disable it.
For instance, here's a sample of the data:
{
"name": "Product name", // not cached
"data": {
"color": "red" // cached
}
}It seems the cache is only hit upon a page refresh, not when navigating to the route. Any insights would be appreciated!