The starting point
Cache Index
Know what is stored, why it can be reused, and when it stops being useful.
The idea, in context
A cache saves work by retaining something that may be needed again. In this guide, a cache index is the lookup layer that connects a request or identity to that stored material and its reuse rules. It is a practical design term, not one universal database or industry standard. A useful record tells you more than where a value lives: it explains the context that makes the value valid. Start with that context before choosing a storage engine or optimizing the hit rate.
Identity comes first
Write down the smallest set of facts that makes two requests equivalent. A document identifier alone may be insufficient if its language, version, permissions, or output format changes the answer. Treat the key as a statement about equivalence, then test that statement against real examples.
Freshness is a decision
Choose a reason for reuse to stop: elapsed time, a new source version, an explicit invalidation event, or a change in access. Keep the clock and the policy visible in the record. An entry being present does not, by itself, mean it is safe to return.
A miss needs a clear path
Define what happens when an entry is absent, expired, or unsuitable. Recompute from the authoritative source, handle concurrent requests deliberately, and replace the index record only when the new value is complete. This makes the cache a recoverable optimization rather than an accidental system of record.
Questions about cache index
Is a cache index the same as a search index?
No. A cache lookup finds reusable work under matching conditions. A search index helps retrieve documents or records relevant to a query. A system can contain both, with different correctness rules.
What should I measure first?
Start with correct reuse and an observable miss path. Add hit rate, latency, memory use, and invalidation behavior once you can explain why each returned value is valid.
Start with one good question.
Follow a topic, explore the tradeoffs, and go deeper in the Lab.