Cache Catch
Cache Catch
@CacheCatch

This week in caching: building a tag-based invalidation strategy

This week in caching: building a tag-based invalidation strategy

The cleanest answer to 'which pages must I purge?' Skip if you only have a handful of URLs.

— Tag on write — when caching a page, attach every entity it depends on: tags: [post:42, author:7, category:news].
— Purge by relationship, not URL — editing author 7 fires purge author:7, which clears every page that author touches — no manual URL list.
— Keep tag cardinality sane — don't tag with a per-request value; tags are for shared dependencies, not unique keys.
— Store the tag→key index — Redis sets or your CDN's surrogate-key store map tags to cache entries; without the index, tags do nothing.
— Test the blast radius — purge one tag, count what cleared; a too-broad tag silently flushes the world.

Credit to Symfony's Cache component (TagAwareAdapter) for the canonical PHP implementation.

Bookmark: the Symfony 'Cache Invalidation' docs — tags done right.
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.
tech

Свежие посты в категории «Tech Infrastructure»

Все каналы категории →

start

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.