Picking up from #120. That was on the old cache-manager and closed without anything landing. The rewrite has hooks and L1/L2 now, which I think gets around Bryan's "not generic enough" concern.
Use case is content caches: one upstream entity referenced by many cache entries, need to purge all of them when it changes. Right now that means walking the dependency graph or maintaining a Redis SET by hand. Same thing Symfony's TagAwareAdapter and Next.js revalidateTag do.
await cache.set(key, value, {tags: ['entity:42']})
await cache.invalidateTag('entity:42')
The BEFORE_SET / AFTER_SET hooks look like the right spot. Tag index can just be cache entries under a reserved prefix, no adapter changes. Would need to clear both primary and secondary, and probably go through sync for multi-instance.
Happy to PR if you're up for it.
Picking up from #120. That was on the old cache-manager and closed without anything landing. The rewrite has hooks and L1/L2 now, which I think gets around Bryan's "not generic enough" concern.
Use case is content caches: one upstream entity referenced by many cache entries, need to purge all of them when it changes. Right now that means walking the dependency graph or maintaining a Redis SET by hand. Same thing Symfony's TagAwareAdapter and Next.js
revalidateTagdo.The
BEFORE_SET/AFTER_SEThooks look like the right spot. Tag index can just be cache entries under a reserved prefix, no adapter changes. Would need to clear both primary and secondary, and probably go throughsyncfor multi-instance.Happy to PR if you're up for it.