Response Cache Eviction

Have more questions? Submit a request

Apollo Server’s Full Response Cache plugin (apollo-server-plugin-response-cache) caches the results of operations for a period of time (time-to-live or TTL). After that time expires, the results are evicted from the cache, and the server fully resolves the operation the next time a client executes it.

The most straightforward way to avoid stale data in the response cache is to set a short default TTL. However, this limits the cache's effectiveness for responses that rarely (or never) change.

The Full Response Cache plugin supports advanced cache eviction patterns via custom cache keys in versions3.7.0and later. This enables you to set a longer default TTL and increase the cache's hit rate, because you can selectively evict cached responses when relevant events occur.

Learn more on the dev docs.

Articles in this section

Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.