Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created February 11, 2013 10:01
Show Gist options
  • Select an option

  • Save KristianLyng/4753611 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/4753611 to your computer and use it in GitHub Desktop.
sub vcl_recv {
if (req.restarts == 0) {
set req.http.x-magic = "0";
}
}
sub vcl_hit {
if (obj.http.x-magic != "1") {
purge;
set req.http.x-magic = "1";
return (restart);
}
}
sub vcl_fetch {
if (req.http.x-magic == "1") {
set beresp.http.x-magic = "1";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment