Summary
Implement the invalidation-worker Asynq worker per doc 07 §16.2 that tails the cache_invalidations outbox table. For each row it (1) calls FragmentCache.InvalidateTags, (2) POSTs to the Next.js /api/revalidate webhook, (3) purges Cloudflare cache-tags via API, then (4) deletes the row. Failures are retried with exponential backoff. Crash-safe: if the worker dies mid-run, the row remains and the next invocation picks it up.
Design reference
- docs/07-media-performance.md §16.1, §16.2, §16.3
Acceptance criteria
Dependencies
#fragment-cache, #isr-webhook
Complexity
M
Summary
Implement the
invalidation-workerAsynq worker per doc 07 §16.2 that tails thecache_invalidationsoutbox table. For each row it (1) callsFragmentCache.InvalidateTags, (2) POSTs to the Next.js/api/revalidatewebhook, (3) purges Cloudflare cache-tags via API, then (4) deletes the row. Failures are retried with exponential backoff. Crash-safe: if the worker dies mid-run, the row remains and the next invocation picks it up.Design reference
Acceptance criteria
cache_invalidationsrows in orderpost:{uuid},term:{uuid},user:{uuid},type:{slug},archive:...,media:{uuid},nav:{uuid},site:settings,global)Dependencies
#fragment-cache, #isr-webhook
Complexity
M