How to know when a query miss the cache and its cause?

Hey there, is there any way to know when a query request has missed the cache? and ideally, which fields of the query caused the miss?
Thanks in advance!

1 Like

Are you referring to server-side caching with @cacheControl?

Sorry, I mean the apollo react library

If you’re just asking for the sake of development, and not trying to record things, one of the simplest ways to tell if the data is cached is whether or not the browser is creating network requests.

Since apollo client recommends an in-memory LRU cache by default, anything that you already have cached shouldn’t create a network request. I’m not authoritative on the implementation, but this is how these typically work in-browser.