What is Cache Invalidation?

Technology CommunityCategory: CachingWhat is Cache Invalidation?
VietMX Staff asked 3 years ago

There are only two hard things in Computer Science: cache invalidation and naming things. – Phil Karlton

HTTP caching is a solution for improving the performance of your web application. For lower load on the application and fastest response time, you want to cache content for a long period (TTL). But at the same time, you want your clients to see fresh (validate the freshness) content as soon as there is an update.

Cache invalidation gives you the best of both worlds: you can have very long TTLs, so when content changes little, it can be served from the cache because no requests to your application are required. At the same time, when data does change, that change is reflected without delay in the web representations.