Problem/Motivation

This comes out of a discussion with @graham.arrowsmith, @guptahemant and @wouter.adem. Please credit them 😊🙏

See https://www.drupal.org/node/2988067 (introduced in #2985297: Generalize the concept of entity synchronization, first shipped in Drupal 8.7) and in particular https://www.drupal.org/node/3098920 (introduced in #2914174: Improve hook_install() to include recommendations for config import and pass an $is_syncing argument, first shipped in Drupal 8.9).

Configuration
When importing configuration, there is a large number of cache tags being purged. It does not make sense to trigger PURGE requests to reverse proxies for each of those individually. The Purge module should be aware of a sync going on, and if so, purge the entire domain afterwards. Unless only a small number of config is imported.
→ Note that this occurs not only when (un)installing modules, but also when importing/syncing configuration.
→ That would make https://www.drupal.org/project/purge_control obsolete.
Content
It is also possible that the "syncing" flag will be set on content entities (since #2985297: Generalize the concept of entity synchronization). This can happen when:

There is a point where if the scale of the import (i.e. the number of invalidated cache tags) becomes large enough, that it makes no sense anymore to purge each cache tag individually, but instead purge the entire site on all active reverse proxies (e.g. both Varnish + CDN). That would remove the need for https://www.drupal.org/project/purge_everything_queuer.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork purge-3254153

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Wim Leers created an issue. See original summary.

japerry made their first commit to this issue’s fork.

japerry’s picture

Status: Active » Needs review

Proposed MR:

  • During config import (drush config:import), tags are buffered instead of queued immediately
  • At request end, if buffered tags exceed threshold (default: 100), queues a single "everything" invalidation
  • Falls back to individual tags if "everything" type isn't supported by any purger

The only piece that is configurable is the threshold, and its via config only, since I doubt there is a need to really mess with this often.