Problem/Motivation
We get requests every once in awhile to "Purge specific URLs from Fastly". I would love to add some simple feature for this to the admin side and allow for a CMS user to do this functionality without access to the Fastly Admin
Proposed resolution
I created a patch to add the feature to the Fastly Module:
- Admin page where CMS user can submit a URL to be purged.
- A single permission to allow a user role to either view this admin page, or see the form item on an existing form.
- The actual submit function just needs to run as tge command:
"\Drupal::service('fastly.api')->purgeUrl('$urlToBePurged');"
In the form class, dependency injection is used:
$this->api->purgeUrl(trim($url))
User interface changes
It is creating a New tab

API changes
No
Data model changes
No
| Comment | File | Size | Author |
|---|---|---|---|
| fastly-purge-by-url.patch | 3.97 KB | zahord |
Issue fork fastly-3438700
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
zahord commentedComment #3
zahord commented