Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teamdeeson/cf_purge
A Drupal module to provide programmatic purging of the Cloudflare cache
https://github.com/teamdeeson/cf_purge
Last synced: 18 days ago
JSON representation
A Drupal module to provide programmatic purging of the Cloudflare cache
- Host: GitHub
- URL: https://github.com/teamdeeson/cf_purge
- Owner: teamdeeson
- Created: 2021-06-01T11:29:02.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2021-06-11T08:53:42.000Z (over 3 years ago)
- Last Synced: 2024-11-17T21:27:45.349Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CF Purge - Cloudflare cache purge service.
This module allows the programmatic purging of the Cloudflare cache.
## Getting started.
Add the following to the `repositories` section of your site's `composer.json` file
```javascript
{
"type": "vcs",
"url": "https://github.com/teamdeeson/cf_purge.git"
}
```### Add the following config to settings
```php
purgeByUrl($urls);
```## Purging everything.
To purge the whole Cloudflare cache, there is this function available:
```php
$purge_service = \Drupal::service('cf_purge.service');
$purge_service->purgeAll();
```## Drush command utility.
There is a drush command file which allows you to purge the whole cache or purge a single url.
To purge the whole cache you can use:
`drush @docker cf-purge:purge-all`
The purge a url:
`drush @docker cf-purge:purge-url [url]`
Where:
* url is single URL.
e.g. the following drush command purges a URL from the Cloudflare cache.
`drush @docker cf-purge:purge-url http://www.example.tld`