https://github.com/phase2/purge_all
Facilitate purging entire Drupal site via Expire module.
https://github.com/phase2/purge_all
cache drupal proxy
Last synced: 8 months ago
JSON representation
Facilitate purging entire Drupal site via Expire module.
- Host: GitHub
- URL: https://github.com/phase2/purge_all
- Owner: phase2
- Created: 2016-04-04T18:57:39.000Z (almost 10 years ago)
- Default Branch: 7.x-1.x
- Last Pushed: 2016-04-04T18:59:04.000Z (almost 10 years ago)
- Last Synced: 2025-05-15T18:51:43.292Z (10 months ago)
- Topics: cache, drupal, proxy
- Language: PHP
- Size: 2.93 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Purge All
> Facilitate purging entire Drupal site via Expire module.
[Expire module](https://www.drupal.org/project/expire) has a longstanding gap in
support of purging an entire site (or the domain associated with an entire site)
based on the configured trigger actions it provides.
## Module Implementation
This module builds on [Purge module](https://www.drupal.org/project/purge), but
has such a basic use case compared to much of the Purge module's plumbing that
it is largely leverage Purge configuration without touching the Purge API.
You can configure Purge All via the Expire module. Purge All settings and actions
will only be triggered if the Purge module has been selected as the expiration
method.
## Infrastructure Requirements
In order for this module to work, your proxy cache must be configured to receive
a custom HTTP request method: `PURGEALL`. The URL submitted to the proxy should
be wildcard purged.
Here is an example of a Varnish4 VCL to support PURGEALL:
```
if (req.method == "PURGEALL") {
// Purge all objects from cache that match the incoming host
ban ("req.url ~ ^/ && req.http.host == " + req.http.host);
return (synth(200, "Purged"));
}
```
## Todos
* Remove duplicate code from `includes/PurgeAllExpireNode.php` if Expire module makes that possible.
* Support entity types other than Node.
## Credits
This module is built on the excellent work in [Drupal Issue #1304812](https://www.drupal.org/node/1304812), especially:
* [mauritsl](https://www.drupal.org/u/mauritsl) for original issue and Varnish3 VCL
* [sokrplare](https://www.drupal.org/u/sokrplare) for HTTP PURGEALL request.