Permalink
Browse files

Modify URL after vcl_hash, so that purge works as expected

  • Loading branch information...
1 parent 2884214 commit 8d1aa8b30b5d430799eb6ee85c21d80e063e9ea4 Lasse Karstensen committed Mar 8, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 tests/073-example3.vtc
View
@@ -7,8 +7,9 @@ server s1 {
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
- sub vcl_recv {
- call devicedetect;
+ sub vcl_recv { call devicedetect; }
+
+ sub append_ua {
if ((req.http.X-UA-Device) && (req.request == "GET")) {
# if there are existing GET arguments;
if (req.url ~ "\?") {
@@ -21,6 +22,10 @@ varnish v1 -vcl+backend {
}
}
+ # do this after vcl_hash, so all Vary-ants can be purged in one go. (avoid ban()ing)
+ sub vcl_miss { call append_ua; }
+ sub vcl_pass { call append_ua; }
+
# Handle redirects, otherwise standard Vary handling code from previous examples.
sub vcl_fetch {
if (req.http.X-UA-Device) {

0 comments on commit 8d1aa8b

Please sign in to comment.