HTTP cache invalidation: sub-resource collections need an extension point
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Área
- backend, backend-api-design
Línea de trabajo
Empieza leyendo las implementaciones existentes de PurgeHttpCacheListener y Serializer\TagCollectorInterface; después, inspecciona el área src/HttpCache/ y la integración con Symfony y Laravel. Se considera terminado cuando la nueva interfaz de proveedor está disponible, los proveedores opcionales se agregan y ambos listeners los consultan, las etiquetas producidas se añaden y este punto de extensión está documentado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
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:
namespace ApiPlatform\HttpCache;
interface PurgeTagProviderInterface
{
/**
* @return iterable<string> additional cache tags to invalidate for $entity
*/
public function getTagsForResource(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 LaravelPurgeHttpCacheListener. - Document the seam alongside
TagCollectorInterface.
- Lenguaje dominante
- PHP
- Estrellas
- 2.6k
- Forks
- 987
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 84
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de api-platform/core
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
api-platform/core#8660 ·
Los mantenedores suelen responder en 1 día
-
DeserializeProvider calls PartialDenormalizationException::getErrors(), deprecated in Symfony 8.1Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
api-platform/core#8650 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
api-platform/core#8649 ·
Los mantenedores suelen responder en 1 día
-
`OrderExtension` and `OrderFilter` pass string sort directions, deprecated since `doctrine/orm` 3.7Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
api-platform/core#8648 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
api-platform/core#8647 ·
Los mantenedores suelen responder en 1 día
Todos los issues de api-platform/core
Issues similares
-
Python 3.15 supportPosiblemente ocupada @amnesiaof la tomó hoy. AbiertoL: python L: python:uv
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dependabot/dependabot-core#16524 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
crazy-goat/rabbit-stream#830 ·
Los mantenedores suelen responder en 1 día
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 4 días
-
Перевод устарел
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100