Skip to Content

Optimizing the cache hit rate

Stellate’s Automatic Cache Invalidation, the Purging API made available based on your schema, and fine-grained Cache Rules ensure our customers get the highest cache hit rate possible. We usually see cache hit rates ranging from 50% to 95% depending on the use case.

There are some reasons beyond the configuration and purging that affect the cache hit rate:

  • Authenticated users: Query results that differ between authenticated users should be cached separately with Scopes.
  • Multiple locations: Every one of Stellate’s 100+ worldwide locations has its own local cache.
  • Query size and other limits: If you respond with large amounts of data (133mb+), we might not be able to cache it.
  • LRU caching: Finally, we use a least-recently-used (LRU) cache, so uncommonly requested data might be evicted before the maxAge or swr time expires. For more information, see the “Least Recently Used” subtopic in Cache Replacement Policies.

We also recommend taking a look at our Caching Metrics Insights topic to understand how you can use these metrics to improve your cache hit rate.

If necessary, contact us at support@stellate.co to talk through specific strategies to optimize your cache hit rate.

Last updated on