Site Confidence All articles
Platform Reliability

The Fix That Didn't Land: Rehearsing Cache Invalidation with Evidence

Site Confidence
The Fix That Didn't Land: Rehearsing Cache Invalidation with Evidence

Photo: European Space Agency, CC BY-SA 3.0 igo, via Wikimedia Commons

A price is corrected in the database at 09:14. At 09:40 a customer screenshots the old price on a product page served from an edge location three hundred miles from your origin. The fix landed. The correction did not. Between those two facts sits an entire class of trust incident that most organisations have no rehearsal for.

Stale content is a trust incident with a long tail

The obvious case is price. The more damaging cases are quieter. A recalled product still purchasable. A legal notice superseded weeks ago. A delivery-cut-off date that has already passed. Worst of all, an incident banner that should have been withdrawn at 23:00 and is still sitting at the top of the homepage the next morning, telling customers that checkout is unavailable while checkout is demonstrably fine.

Each of these is a statement your organisation is making about itself, served at scale, with the authority of a page the customer trusts. Cache invalidation is therefore not a delivery concern. It is a truth-maintenance control.

Who is allowed to purge

Start with permissions, because the fastest way to fail this drill is to discover at 02:00 that nobody on call holds a purge credential.

Define named roles rather than shared accounts: a purge operator per shift, a supervisor for high-impact keys, and a documented break-glass path with a second approver for production-wide purges. Store purge API keys in a secret manager, not in a runbook wiki. Require a ticket reference or incident number with every purge request, and log the request, the actor, the key set and the timestamp in a system that survives the incident.

A purge is a destructive action against a shared resource. Treat it with the ceremony you would give a database migration, and no more.

Surrogate keys do the real work

Purging by URL enumeration does not scale and never covers the long tail. Tag responses with surrogate keys at render time and purge by tag. Typical keys might include a product identifier, a category identifier, a price-feed version, a legal-notice version, and the identifier of an active incident banner.

Key coverage is where this fails in practice. A page assembled from three includes needs all three keys attached, and a drill is the only reliable way to find the one that was forgotten. Inspect the response headers for the composite page, not for each fragment, and confirm that the key list matches what the page actually contains.

The drill, step by step

  1. Publish a canary token: a harmless string in a footer or on an internal test SKU, rendered through the normal template path.
  2. Change the token at origin.
  3. Purge by surrogate key, using the same tooling an on-call engineer would use under pressure.
  4. Verify from at least three distinct networks: a corporate connection, a mobile network, and a proxy in a different region. A single laptop on office Wi-Fi proves nothing.
  5. Inspect the response headers: cache status, the Age value after purge, and any stale-serving directives still in play.
  6. Check the layers behind the CDN: browser caches, service workers, any application-level cache, the search index, personalisation stores, and the templates behind transactional email.

Record every step. The output of the drill is not a passing test, it is a purge receipt.

Propagation is a distribution, not a moment

A purge does not complete; it converges. Sample it. Purge one hundred objects and request one hundred URLs at ten-second intervals, then plot the convergence curve. Set a service level in advance — for example, ninety-nine per cent of targeted objects refreshed within sixty seconds — and measure the tail rather than the median.

The tail is where the incidents live: the one edge location with a longer TTL, the one object pinned by a stale-while-revalidate directive, the one mobile carrier proxy that holds content for far longer than any header suggested. If your drill only samples the nearest location, you have measured your own desk.

The rollback plan for the rollback

Every purge creates a second risk: the origin behind it now takes the full traffic that the cache was absorbing. Before purging a high-traffic key set during peak, confirm three things.

Write the sequence down as a runbook: purge, verify, roll back if origin degrades, restore, verify again. Rehearse it once with a low-traffic key set before the golden quarter makes the decision for you.

During peak trading

Set a change-freeze window for cache configuration, appoint a purge authority rota, and give on-call a prepared communications line for the case where customers are still seeing the old price. A short, honest banner outperforms a silence that customers interpret as evasion.

What evidence looks like at close

The closure note should contain the purge identifier and timestamp, the key list, the verification screenshots with source networks and times, the convergence figure against the agreed service level, and the name of the person who approved it. That document is what turns a cache purge from an act of faith into a trust control you can defend in a post-incident review — and, if it comes to it, to a regulator or an unhappy customer. Rehearse it while the stakes are still low.

All Articles

Related Articles

The Voice at the Other End: Rehearsing Identity Checks on the Festive Helpdesk

The Voice at the Other End: Rehearsing Identity Checks on the Festive Helpdesk

Fallback Address: Drilling Postcode Lookup Failure Before the Peak

Fallback Address: Drilling Postcode Lookup Failure Before the Peak

Before the Customer Clicks: Rehearsing Magic-Link Logins Against Inbox Prefetchers

Before the Customer Clicks: Rehearsing Magic-Link Logins Against Inbox Prefetchers