- Issue created by @guaneagler
- π¨π³China guaneagler
Update the patch file for empty invalidations.
- πΊπΈUnited States brockfanning
This makes a lot of sense to me. If the tags are not being communicated to Akamai, then there is no reason to try to invalidate them in Akamai. It's just a lot of unnecessary API traffic.
- π¦πΊAustralia Feng-Shui
This would solve a related issue that we have. We use a number of cache tags for internal use that are never added to requests, but when they are invalidated, they are also purged from Akamai. We're sending tens-of-thousands of additional purge requests weekly for tags that never go out via cache headers.
This patch resolves our issue.
I think there's potentially two additional changes that could be looked at:
1: The UX of the settings form has the "Cache Tag Blacklist" field under "Edge-Cache-Tag Header Settings" - this patch would now have that setting affecting invalidations too, that's not clear from the language on that form so it may need a tweak.
2: Further on in the invalidate() method there's the following code:
// Instantiate event and alter tags with subscribers. $event = new AkamaiPurgeEvents($tags_to_clear); $this->eventDispatcher->dispatch($event, AkamaiPurgeEvents::PURGE_CREATION); $tags_to_clear = $event->data;
I think there should be an additional check here to see if $tags_to_clear is empty. Currently there's no way for an event subscriber to remove tags (which is how I was looking to resolve our issue before I found this issue), and for the purge request to halt if there was nothing to purge.
Happy to roll a new version of the patch if there's agreement on these changes, don't want to hijack a related issue.