Tinker Caching & CDNs

by Samy (Kondasamy Jayaraman) · drawn with Colorfigures by April Zhu

10:15, wait for the ttl: 201 stale prices and 60 stale photos today.12 from shelves · 0 to the depot · 0 trips · 6 stale

Chapter 4 of 7

Take it back

A 15-minute TTL fixed most stale prices but cost trips, and a few still slipped through. The team wants long TTLs and correct prices.

This chapter: How do you take back a copy you already handed out?

About this chapter

You will learn

  • A purge drops a copy everywhere the moment it changes
  • A versioned name gives changed content a new address
  • Which suits prices, and which suits photos

Words you’ll meet

Purge
A message telling every cache to drop its copy of something, now.
Versioned name
A name that changes with the content, like hinge-2.jpg, so no cache holds the new one yet.

Step 1 of 4

Short TTLs cost trips. Instead, staff can send a when they change a price: every warehouse drops its copy.

Predict the stale prices.

With a purge at every price change and a TTL of a whole day, how many stale price reads?