Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

adds support for varnish_ban_key #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ Varnish URL supports multiple servers, separate with comma. E.g `http://1.1.1.1,
```
UPPER_DRIVER=varnish
VARNISH_URL=<REPLACE-ME>
VARNISH_BAN_KEY=<UID>
```
`VARNISH_BAN_KEY` lets you specify a unique id which you can pick up in your VCL and issue the correct bans. Very useful when you have multiple sites hosted on the same backends and you want to control what to ban.

### Tuning

Expand Down
1 change: 1 addition & 0 deletions src/drivers/Varnish.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function purgeUrls(array $urls)
*/
public function purgeAll()
{
$this->headers['Varnish_Ban_Key'] = getenv('VARNISH_BAN_KEY');
return $this->sendPurgeRequest([
'headers' => $this->headers
], 'BAN');
Expand Down