Caching

Caching

Can reduce the load on servers by storing the results of common operations and serving the precomputed answers to clients.

For example, instead of retrieving data from database tables that rarely change, you can store the values in-memory.

A cache can be created for multiple layers of the stack.

Caching backends

Caching resources

Caching learning checklist

  1. Analyze your web application for the slowest parts. It's likely there are complex database queries that can be precomputed and stored in an in-memory data store.

  2. Leverage your existing in-memory data store already used for session data to cache the results of those complex database queries. A task queuearrow-up-right can often be used to precompute the results on a regular basis and save them in the data store.

  3. Incorporate a cache invalidation scheme so the precomputed results remain accurate when served up to the user.

Last updated