Skip to content

Instantly share code, notes, and snippets.

@ThijsFeryn
Last active November 12, 2015 14:04
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 ThijsFeryn/2e06e3596d41e4ff3dda to your computer and use it in GitHub Desktop.
Save ThijsFeryn/2e06e3596d41e4ff3dda to your computer and use it in GitHub Desktop.
VCL snippet that contains the minimum amount of config to support ESI using Surrogate headers
vcl 4.0;
backend default {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
set req.http.Surrogate-Capability = "key=ESI/1.0";
}
sub vcl_backend_response {
if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
unset beresp.http.Surrogate-Control;
set beresp.do_esi = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment