Skip to content

Instantly share code, notes, and snippets.

@asquelt

asquelt/LOG Secret

Created December 13, 2012 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asquelt/07f6280ae9345dc315b7 to your computer and use it in GitHub Desktop.
Save asquelt/07f6280ae9345dc315b7 to your computer and use it in GitHub Desktop.
PURGE as MISS
13 SessionOpen c 10.100.108.76 36667 :6081
13 ReqStart c 10.100.108.76 36667 2105324923
13 RxRequest c PURGE
13 RxURL c /
13 RxProtocol c HTTP/1.1
13 RxHeader c X-purge: /userPublicLocationHeader/KaSiAx93.0/userPublicLocationHeader/KaSiAx93.1/userPublicLocationHeader/KaSiAx93.2/userPublicLocationHeader/KaSiAx93.3
13 RxHeader c Host: fwcache1:6081
13 RxHeader c Connection: Keep-Alive
13 VCL_call c recv
13 VCL_acl c MATCH fw_purge 10.100.108.0/24
13 VCL_return c lookup
13 VCL_call c hash
13 Hash c /userPublicLocationHeader/KaSiAx93.0
13 VCL_return c hash
13 VCL_call c miss
13 VCL_acl c MATCH fw_purge 10.100.108.0/24
13 VCL_return c error
13 VCL_call c error restart
13 VCL_call c recv
13 VCL_acl c MATCH fw_purge 10.100.108.0/24
13 VCL_return c lookup
13 VCL_call c hash
13 Hash c /userPublicLocationHeader/KaSiAx93.1
13 VCL_return c hash
13 VCL_call c miss
13 VCL_acl c MATCH fw_purge 10.100.108.0/24
13 VCL_return c error
13 VCL_call c error restart
13 VCL_call c recv
13 VCL_acl c MATCH fw_purge 10.100.108.0/24
13 VCL_return c lookup
13 VCL_call c hash
13 Hash c /userPublicLocationHeader/KaSiAx93.2
13 VCL_return c hash
13 VCL_call c miss
13 VCL_acl c MATCH fw_purge 10.100.108.0/24
13 VCL_return c error
13 VCL_call c error restart
13 VCL_call c recv
13 VCL_acl c MATCH fw_purge 10.100.108.0/24
13 VCL_return c lookup
13 VCL_call c hash
13 Hash c /userPublicLocationHeader/KaSiAx93.3
13 VCL_return c hash
13 VCL_call c miss
13 VCL_acl c MATCH fw_purge 10.100.108.0/24
13 VCL_return c error
13 VCL_call c error deliver
13 VCL_call c deliver deliver
13 TxProtocol c HTTP/1.1
13 TxStatus c 404
13 TxResponse c Not in cache
13 TxHeader c Server: Varnish
13 TxHeader c Content-Type: text/html; charset=utf-8
13 TxHeader c Retry-After: 5
13 TxHeader c Content-Length: 398
13 TxHeader c Accept-Ranges: bytes
13 TxHeader c Date: Thu, 13 Dec 2012 18:47:34 GMT
13 TxHeader c X-Varnish: 2105324923
13 TxHeader c Age: 0
13 TxHeader c Via: 1.1 varnish
13 TxHeader c Connection: close
13 TxHeader c X-Cache: MISS from fwcache1.non.3dart.com
13 Length c 398
13 ReqEnd c 2105324923 1355424454.202958107 1355424454.203320265 0.000046730 0.000318050 0.000044107
13 SessionClose c error
acl fw_purge {
"10.100.108.0"/24;
}
sub vcl_recv {
if (req.request == "PURGE") {
set req.http.wont-cache = "true";
if(client.ip !~ fw_purge) {
error 405 "Not allowed.";
}
if (req.http.X-ban-regex) {
ban("obj.http.x-hash ~ ^" + req.http.X-ban-regex+"$");
error 200 "Banned";
} else if (req.http.X-ban-single) {
ban("obj.http.x-hash == " + req.http.X-ban-single);
error 200 "Banned";
} else if (req.http.X-purge) {
set req.url = regsub(req.http.X-purge, "^(/[^/]+)(/[^/]+).*$", "\1\2");
set req.http.X-purge = regsub(req.http.X-purge, "^/[^/]+/[^/]+(.*)$", "\1");
set req.http.can-cache = "true";
return (lookup);
} else {
set req.http.can-cache = "true";
return (lookup);
}
}
}
sub vcl_hit {
if (req.request == "PURGE") {
if(client.ip !~ fw_purge) {
error 405 "Not allowed.";
}
purge;
error 200 "Purged";
}
}
sub vcl_miss {
if (req.request == "PURGE") {
if(client.ip !~ fw_purge) {
error 405 "Not allowed.";
}
purge;
error 404 "Not in cache";
}
}
sub vcl_error {
if (req.http.X-purge && req.http.X-purge != "") {
return (restart);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment