Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Download Tracker 1.0.7 — Minor update available for module download_tracker (1.0.7). Release: Directory2Block Slideshow 1.0.8 — Minor update available for module directory2block_slideshow (1.0.8). Release: Mautic Audiences 1.1.5 — Minor update available for module mautic_audiences (1.1.5). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: RightUp 1.0.2 — Minor update available for module rightup (1.0.2). Release: CronWatch 0.12.1 — Minor update available for module cronwatch (0.12.1). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Adds a form to purge Urls from configured caching instances. Also provides Drush commands to enqueue purges of the whole cache.

This is a major refactor (might be called a fork) of https://github.com/BurdaMagazinOrg/module-custom_purge. The config schema of this refactor is not backwards-compatible, i.e. if you want to migrate to this refactor, you'd need to adjust the configuration accordingly. Also, Drush commands have changed due to the introduction of a new queue-based approach.

This refactor introduces the concept of queued purge operations, mainly when purging everything from your beloved caching instances. When a purge operation is to be run is mainly set via the delay_complete_purge configuration key (more details see example below).

The module is built with a plugin system, so additional caching instances that need to be purged can be added that way. Included purge plugins:

  • Drupal's internal page cache
  • Varnish (might be too custom / specific, you might need to write your own Varnish plugin)
  • Cloudflare

Requirements:

  • Drush 9 or 10
  • A working and regular Cron run or...
  • ...alternatively, schedule a cron job that requlary runs drush queue:run custom_purge_urls --items-limit=100 and drush queue:run custom_purge_everything --items-limit=100. One queue item is supposed to take approximately one second of processing time.

If you are using the queue:run command and ask yourself why so many items were processed: In case an item did not reach the configured delay_complete_purge yet, it re-throws itself into the queue (with additional wait time of one second). It does only perform a purge request when that delay is reached.

Since this module does not come with a form for the custom_purge.settings configuration, you'd need to manually edit that yml file.
Example configuration of custom_purge.settings.yml:

profile: production
profiles:
  production:
    max_url_per_request: 25
    flood_interval: 24
    flood_limit: 100
    cache_instances:
      -
        cache_type: drupal_page_cache
        cache_name: internal_page_cache
        allow_url_purge: true
        allow_purge_everything: true
        delay_complete_purge: 0
        cid_extensions:
          - ':'
          - ':html'
          - ':json'
          - ':xml'
          - ':xhtml'
      -
        cache_type: varnish
        cache_name: my_varnish
        allow_url_purge: true
        allow_purge_everything: true
        delay_complete_purge: 1800
        ip: 127.0.0.1
        port: 443
        verifyhost: false
        verifypeer: false
        single:
          http_method: DELETE
          http_headers: {  }
        everything:
          http_method: BAN
          http_headers: {  }
          url: '/ban-url'
      -
        cache_type: cloudflare
        cache_name: my_cloudflare
        allow_url_purge: true
        allow_purge_everything: true
        delay_complete_purge: 3600
        use_cf_settings: false
        email: cloudflaremail@localhost
        zone_id: '123456'
        apikey: fdghg5435sdfg
    domains:
      -
        is_default: true
        default_protocol: https
        domain: mydrupalsite.local
        assigned_cache_instances:
          - internal_page_cache
          - my_varnish
          - my_cloudflare
      -
        is_default: false
        default_protocol: https
        domain: anotherdomainofmydrupalsite.local
        assigned_cache_instances:
          - internal_page_cache
          - my_varnish_cache
          - my_varnish

When you're done, import that config with drush cim.

This module tries to be relatively small. If you need more extensibility and support of more third party providers, use the Purge module.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Mar 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
1.0.0-rc6 Pre-release Apr 18, 2024
1.0.0-rc5 Pre-release Apr 16, 2024
1.0.0-rc4 Pre-release Apr 1, 2024
1.0.0-rc3 Pre-release Apr 1, 2024
1.0.0-rc2 Pre-release Mar 14, 2023