Blacklist for purge invalidate

Created on 21 February 2023, over 2 years ago

Currently, akamai support to config blacklist to not add the tags in the blacklist to the header
But when we purge the cache, the tag in the blacklist will be sent to the akamai. So if the tag is not in the response header, there is no meaning to add it to the purge request, right?

Workaround: Exclude the tag from purge request
It may be better exclude it from the queue, but the queue is used by multiple purger, so not sure if we have a better way to do this.

✨ Feature request
Status

Active

Component

Code

Created by

πŸ‡¨πŸ‡³China guaneagler

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @guaneagler
  • πŸ‡¨πŸ‡³China guaneagler

    Just add a workaround.

  • πŸ‡¨πŸ‡³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.

Production build 0.71.5 2024