Problem/Motivation
The example Varnish configuration converts cache tags to lower case when a BAN request for tags is received, but the tag compression explicitly uses lower *and* upper case letters to compress cache tags. This causes roughly half of all cache tags to be ignored when they are invalidated.
Steps to reproduce
Somewhat hard to reproduce; your converted cache tag needs to contain one or more upper case letter, and the complete set of cache tags you're invalidating should all contain upper case letters or not be relevant to the content you're trying to update. In practice, it becomes a game of chance whether your content is correctly banned or not.
Proposed resolution
Remove the conversion to lower case from the ban clause in default.vcl
Remaining tasks
- Create MR
- Review
- Merge
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
The example Varnish configuration contained a conversion to lower case on the cache tag invalidation, while this module uses both upper and lower case on compressed cache tags. This means that many cache tags were not correctly matched in Varnish, causing spotty invalidation (if some other tags did not contain upper case characters, they would still trigger a ban, causing erratic banning behaviour). If your Varnish configuration also contains this logic, please change it.
Line to look for:
set req.http.X-Tag = "(^|\s)" + regsuball(std.tolower(req.http.X-Tag), "\ ", "(\\s|$)|(^|\\s)") + "(\s|$)";
Line to replace with:
set req.http.X-Tag = "(^|\s)" + regsuball(req.http.X-Tag, "\ ", "(\\s|$)|(^|\\s)") + "(\s|$)";
Issue fork adv_varnish-3605866
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 #3
eelkeblokComment #4
eelkeblokMaybe this also needs a release notes snippet, as changing the example VCL will obviously not update all the Varnish configs in use out there.
Comment #5
eelkeblokComment #6
eelkeblokComment #8
shumer commented