Choosing a Cache Strategy

Synthetic inspection stages: Read, Activate, Compare.

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

StrategyFreshness modelOrigin requests per 100 reads
No cacheRead current data every time100
Short TTLAccept a short freshness window32
Revision keySelect an explicit content revision9

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 dataset

Activate 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.