You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTP cache invalidation: sub-resource collections need an extension point #7965
PurgeHttpCacheListener (Symfony Doctrine and Laravel Eloquent) cannot invalidate sub-resource collection operations such as /parents/{parentId}/children. Resolving the IRI requires parent uriVariables that the listener does not have when it sees the modified entity, so those collection tags are silently skipped.
Pragmatic solution
Expose a public extension point — symmetric to Serializer\TagCollectorInterface on the response side — that the listener consults to collect extra tags for a given entity:
namespaceApiPlatform\HttpCache;
interface PurgeTagProviderInterface
{
/** * @return iterable<string> additional cache tags to invalidate for $entity */publicfunctiongetTagsForResource(object$entity): iterable;
}
Wiring:
Tagged service (Symfony) / iterator binding (Laravel), aggregated and injected into PurgeHttpCacheListener.
The listener appends whatever the providers yield to its existing tag set.
Default ships with no provider — users opt in.
This keeps identifier-finding out of the framework (the user knows how their child invalidates their parents) and lets each project plug exactly the strategy that fits its routing (parent uri_variables, surrogate-key prefixes, class-based tags, etc.).
Scope
Add the interface in src/HttpCache/.
Inject iterable<PurgeTagProviderInterface> (optional, default empty) into both Symfony and Laravel PurgeHttpCacheListener.
Document the seam alongside TagCollectorInterface.
Activity
fix(symfony): purge all Get IRIs and restore BC item tagging