Northgate Studio

A practical note on cache keys

Notes · 6 min read

Most cache incidents we have been called into were not caused by the cache itself. They were caused by a key that did not describe the response.

Include what changes the answer

Locale, currency, feature flags, authorisation scope. If any of these change the body, they belong in the key.

Version the prefix

A short version prefix lets you invalidate a whole family of entries without a flush.