This project is not covered by Drupal’s security advisory policy.
Block Purge clears the cache of the blocks you choose, and only of those blocks. When a block shows outdated content, clear it in one click, without clearing the cache of the whole site.
Features
- Precise: clears the chosen blocks and the pages they are on. Other blocks and pages keep their cache, so the site stays fast.
- Everywhere: in Drupal's render and page caches, and in reverse proxies or CDNs that follow cache tags, such as Varnish or a CDN through the Purge module.
- From the Block layout: a Clear cache operation on each block.
- Many blocks at once: a page listing the placed blocks, filtered by theme or text, to clear the ones you select.
- Cache information for each block: how long it is cached, what it varies by, and its cache tags, to find out why a block is outdated.
- Optionally clear what the blocks show, such as a custom block, a menu or a view, everywhere it is shown.
- Drush command to clear blocks by name, theme or region.
- Logged: who cleared which blocks.
- Safe: its own permission, and links that cannot be triggered from another site.
Requirements
- Drupal 10.3 or later, or Drupal 11.
- The core Block module.
Installation
Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.
composer require drupal/block_purge drush pm:enable block_purge
Roles with the Administer blocks permission get the Clear block caches permission on installation.
Usage
- In Structure » Block layout, open the operations of a block and choose Clear cache.
- Or go to Configuration » Development » Clear block cache (
/admin/config/development/block-cache-clear), select blocks and click Clear the cache of the selected blocks.
Drush
# One or more blocks, by machine name. drush block-purge:clear olivero_main_menu,olivero_site_branding # Every block of a theme, or of one region. drush block-purge:clear --theme=olivero --region=header # Also what the blocks show, such as the menu of a menu block. drush block-purge:clear olivero_main_menu --content
How it works
Every cached copy of a block is tagged with the block's cache tag, such as config:block.block.olivero_main_menu. Block Purge invalidates those tags, as Drupal does when a block is saved, so only the cached copies that include those blocks are cleared.
Upgrading from 1.0
Run drush updatedb.
Support
Report bugs and request features in the issue queue.
Project information
Maintenance fixes only
Considered feature-complete by its maintainers.- Created by chaitanyadessai on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.