purge_messenger
Security covered
Integrates Purge with Symfony Messenger. allowing for efficient off-thread realtime Purge dispatches.
The module replaces Purge's built-in queue (normally database or memory) with Symfony Messenger, enabling invalidations to be dispatched asynchronously (e.g. to Redis/RabbitMQ/SQS) with deduplication and configurable delays. Workers consuming the Messenger queue then execute the actual purge calls, decoupling cache tag invalidation from HTTP request time.
Installation
- Install the Purge and Purge Messenger modules.
- Navigate to
admin/config/development/performance/purgeand select Change engine under the Queue dropdown. - Select Messenger and save.
- New invalidations will now be intercepted via Symfony Messenger.
- The now-redundant Purge command (
drush p:queue-work) can be disabled.
Configuration
Optional configuration is available:
- Set purge_messenger.delay to delay message delivery
- Set purge_messenger.immediate to buffer invalidations and send them in a batch after the HTTP response is sent.