Why and where to cache
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
know the layers where a cache can sit and what each one saves.
Planned topics
- A cache keeps a copy of an expensive result close to the caller. It trades freshness for speed and load.
- Layers: browser/client (no request at all), CDN (no trip to origin), gateway (no call to the service), application (no database call), database (buffer pool, query cache).
- The closer to the user, the more you save, and the harder invalidation becomes.
- Cache only data that is read often, changes rarely, and is costly to produce.
Draft outline details
Demonstration
a request path diagram: browser → CDN → gateway → Shop catalog service → Redis/Caffeine → PostgreSQL, each hop labelled with what a hit there avoids.
Check your understanding
Which layer saves the most work when it hits?
Show answer
The one closest to the user, e.g. the browser: no request is made.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.