Caching Design
Decides invalidation before anything else, since a cache without an invalidation story is a bug with latency benefits.
Free — no card needed
Create a free account
to open Caching Design — and the other 364 prompts across 21 categories.
Already have an account?
Running it, start to finish
- State how stale the value may be before it matters.
- List every writer and confirm each invalidates.
- Verify the key includes every input the value depends on.
What you get back
The output this produces, every time.
- Starts from staleness tolerance, which determines the whole design.
- Requires you to list every writer, since the one that does not invalidate is the bug.
- Checks the cache key covers every dimension the value depends on, including permissions.
Getting better results
Where this usually goes wrong, and how to avoid it.
- Consider not caching. A better query or an index avoids a second source of truth and a class of bug that is hard to reproduce.
- Plan for the stampede. A popular key expiring under load takes down the system it was protecting, at the worst possible moment.
- Check the key for permissions. Anything permission-dependent cached under a shared key serves one user another's data, and it is not caught by tests.
More Coding prompts
All Coding →- Coding
Refactor With a Safety Net
Plans a refactor as a sequence of individually safe, individually shippable steps, with the characterisation tests that make each one verifiable.
ClaudeChatGPT000Open → - Coding
Review for the Bug, Not the Style
A code review that hunts correctness failures and states the exact input that breaks each one, instead of listing naming preferences.
ClaudeChatGPTGemini000Open → - Coding
Database Migration Plan
Plans a schema change that ships without downtime, in steps that are each independently safe and reversible.
ClaudeChatGPT000Open →
Written for The AI University. Every prompt in this library is original work — authored, tested and revised here, not collected from elsewhere. 365 of them, free with an account.
