Software Architecture · Data & Caching
Cache Invalidation Strategies
Tag-based invalidation keeps the blast radius small.
1 min readPublished Updated
- cache
- invalidation
There are only two hard problems in computer science: cache invalidation and naming things.
ts
async function updateArticle(id: string) {
await db.update(id);
await invalidateTag(`article-${id}`);
}Tag-based invalidation keeps the blast radius small: only the tags a mutation actually affects get revalidated.