-
Notifications
You must be signed in to change notification settings - Fork 21
adds support for varnish_ban_key #29
base: master
Are you sure you want to change the base?
Conversation
I thought this is solved by the keyprefix already, isn't it? |
Key Prefix prevents key collisions when you have multisites in CraftCMS or more CraftCMS installations on same varnish server. Ban key lets you know which domains to ban (based on your own logic in regards to the ban key) when you want to clear the entire cache for a certain domain. So they are different things, but both needed in a multisite setup. |
The BAN is issued when using ./craft clear-caches/upper-purge-all at which point the key prefix is not in the picture. All it does now is issue a ban request to varnish, but you have no way of knowing what to ban, that is what the ban key lets you determine. |
any chance this is getting in soon, need it in production asap? if not I'll just redirect to my fork |
@larsboldt
|
@ostark |
Would love to get this merged so I could stick to the official instead of a fork - what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap it in a if() block and I'll merge it
@larsboldt Seems like this should be a config var, not an explicit env check. |
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.