Choosing a Cache Strategy
Compare three fictional caching approaches using a compact, downloadable dataset.
Choosing a Cache Strategy
There is no universal cache setting. This fictional comparison trades freshness, implementation complexity, and origin traffic against one another. The numbers are invented to make the chart easy to inspect.
Three options
| Strategy | Freshness model | Origin requests per 100 reads |
|---|---|---|
| No cache | Read current data every time | 100 |
| Short TTL | Accept a short freshness window | 32 |
| Revision key | Select an explicit content revision | 9 |
The table and the chart describe the same dataset. A chart should complement the explanation rather than introduce a second unexplained set of values.
Loading current public media…Download datasetActivate Load chart to inspect the bars. The accompanying download is the exact pinned CSV used by the chart: no external analytics service is queried.
An intentionally incomplete sketch
key = article_id + published_revision
value = publication_safe_representation
A revision key still needs a policy for visibility changes. Faster delivery is not permission to serve a withdrawn article.
Questions to ask
- What can become stale?
- Who invalidates a cached representation?
- Does authorization run before a cached response is returned?
- Can the reader understand the result without the chart?
This article is a synthetic teaching example, not a description of a newly enabled cache in this application. Explore time-series presentation in Latency Through the Day.