File tree 2 files changed +22
-6
lines changed
app/code/Magento/PageCache/etc
2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,18 @@ sub vcl_recv {
26
26
if (client.ip !~ purge ) {
27
27
return (synth (405, "Method not allowed"));
28
28
}
29
- if (!req.http.X-Magento-Tags-Pattern ) {
30
- return (synth (400, "X-Magento-Tags-Pattern header required"));
29
+ # To use the X-Pool header for purging varnish during automated deployments, make sure the X-Pool header
30
+ # has been added to the response in your backend server config. This is used, for example, by the
31
+ # capistrano-magento2 gem for purging old content from varnish during it's deploy routine.
32
+ if (!req.http.X-Magento-Tags-Pattern && !req.http.X-Pool ) {
33
+ return (synth (400, "X-Magento-Tags-Pattern or X-Pool header required"));
34
+ }
35
+ if (req.http.X-Magento-Tags-Pattern ) {
36
+ ban (" obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern );
37
+ }
38
+ if (req.http.X-Pool ) {
39
+ ban (" obj.http.X-Pool ~ " + req.http.X-Pool );
31
40
}
32
- ban (" obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern );
33
41
return (synth (200, "Purged"));
34
42
}
35
43
Original file line number Diff line number Diff line change @@ -27,10 +27,18 @@ sub vcl_recv {
27
27
if (client.ip !~ purge ) {
28
28
return (synth (405, "Method not allowed"));
29
29
}
30
- if (!req.http.X-Magento-Tags-Pattern ) {
31
- return (synth (400, "X-Magento-Tags-Pattern header required"));
30
+ # To use the X-Pool header for purging varnish during automated deployments, make sure the X-Pool header
31
+ # has been added to the response in your backend server config. This is used, for example, by the
32
+ # capistrano-magento2 gem for purging old content from varnish during it's deploy routine.
33
+ if (!req.http.X-Magento-Tags-Pattern && !req.http.X-Pool ) {
34
+ return (synth (400, "X-Magento-Tags-Pattern or X-Pool header required"));
35
+ }
36
+ if (req.http.X-Magento-Tags-Pattern ) {
37
+ ban (" obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern );
38
+ }
39
+ if (req.http.X-Pool ) {
40
+ ban (" obj.http.X-Pool ~ " + req.http.X-Pool );
32
41
}
33
- ban (" obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern );
34
42
return (synth (200, "Purged"));
35
43
}
36
44
You can’t perform that action at this time.
0 commit comments