1/6
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What is caching?
A cache is fast storage holding a copy of something expensive to produce. Check the cache first; on a miss, do the expensive thing and put the result in the cache for next time.
Places where caching happens
In the browser, so the request never leaves the device.
At the CDN, so it never reaches your data center.
At the API gateway, so it never reaches a service.
In the application, in memory or in Redis or Memcached, so it never reaches the database.
Inside the database, which keeps hot pages in memory on its own.
The hard part of caching is…
The hard part of caching is never the reading. It is deciding what happens when the underlying data changes, and how the cache and the database are kept consistent with each other.
How do we avoid doing the same work twice?
Cache
When to skip cache?
Write-heavy, low read repetition
One way to improve latency is…
Cache. A cache is a small fast store that keeps ready-made answers. A hit skips the slow work entirely.