EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
Trimming the cache
Trimming the cache
By default, if you don't use expiration and garbage collection, the cache will grow indefinitely as more data is written to it.
To prevent this, a few APIs are available:
ApolloStore.clearAll(): clear the entire cache.ApolloStore.remove(): remove specific records.ApolloStore.removeOperation()andApolloStore.removeFragment(): remove the records associated to specific operations or fragments.ApolloStore.trim(): trim the cache by a specified amount (by default 10%) if it exceeds a certain size. The oldest (according to their updated date) records are removed.