sofascore / purgatory-bundle

Invalidate caches and achieve high hitrate with readable and maintainable annotations
MIT License
45 stars 0 forks source link

Purge old url if entity property is change #30

Open jstuhli opened 2 years ago

jstuhli commented 2 years ago

Describe the bug If the property being changed is in the url then we must purge both urls.

Eg.

Lets say we have Post and Tag entities. For simplicity lets say that Post has a single Tag ManyToOne relation. if we have an endpoint /tag/{name}/posts and we purge on Tag.name change then (currently) only the new {name} will be purged but the old one won't and it will contain stale data. Same is true if the Post changes it's Tag.

If the changeset of the entity contains the url parameter that needs to be purged, library should queue 2 urls instead of one. If there are multiple parameteres then a cartesian product of all the parameters should be queued.