Commit aeb46a6c authored by Artem Dmitriiev's avatar Artem Dmitriiev
Browse files

Issue #3261691: Optimize tag invalidation

parent ada4886b
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -183,12 +183,16 @@ class StackPathApi {
    $params = ['items' => []];
    switch ($type) {
      case 'tags':
        $tags = [];
        // Collect all tags.
        foreach ($invalidations as $invalidation) {
          $tag = $this->createHashTag($invalidation);
          $tags[] = $this->createHashTag($invalidation);
        }
        // Create purge selector to have 1 url per request.
        $purgeSelector = [
          'selectorType' => 'TAG',
          'selectorName' => 'X-Tag',
            'selectorValue' => $tag,
          'selectorValue' => implode(',', $tags),
          'selectorValueDelimiter' => ',',
        ];
        $params['items'][] = [
@@ -197,7 +201,6 @@ class StackPathApi {
          'recursive' => TRUE,
          'invalidateOnly' => FALSE,
        ];
        }
        break;

      case 'url':