Name some Cache Writing Strategies

Technology CommunityCategory: CachingName some Cache Writing Strategies
VietMX Staff asked 3 years ago

There are two common strategies to write data in a cache:

  1. Pre-caching data, for small pieces of data, usually during the application initialization, before any request.
  2. On-demand, checking first if the requested data is in the cache (if the data is found, it is called a cache hit), using it, improving the performance of the application. Whenever the requested data has not been written to the cache (cache miss), the application will need to retrieve it from the slower source, then writing the results in the cache, thus saving time on subsequent requests for the same data.