Kapsule Field NotesKapsule Field Notes

Caches that lie in only one direction

Mon Feb 02

A cache that serves stale content is a bug you will find. A cache that stores the wrong content is one you will not.

Every team learns the first kind quickly. Somebody publishes a change, the page does not move, and somebody clears the cache. The feedback loop is short and the fix is obvious.

The second kind is quieter. A response gets stored under a key that does not describe it: a page varying by language stored without the language in the key, a logged-in view stored under the anonymous one. Now the cache is not stale, it is wrong, and it is wrong for somebody else.

The tell is that the report never reproduces. It happens to a customer in another country, or to whoever asked second. If a bug only happens to the second person, look at what the first person put in the cache.

Back to all notes