Skip to content
We areTOP 1%

What is caching, and where can caches be placed in a system?

EasyConceptCaching
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

Caching keeps a copy of data in fast storage close to where it is needed, trading memory and some staleness for lower latency and less load on the source. Caches can exist at almost every layer of a request path.

  • Client: the browser or mobile app caches responses according to HTTP headers such as Cache-Control and ETag.
  • CDN and reverse proxy: edge servers cache static assets and some API responses near users.
  • Application: an in-process cache is fastest but separate for each instance; a distributed cache such as Redis or Memcached is shared by all instances.
  • Database: buffer pools keep hot pages in memory.
  • Measure the hit ratio; a cache that rarely hits only adds complexity and another failure point.

More in Caching

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account