Skip to content

Instantly share code, notes, and snippets.

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 stefanoverna/50384c771d775ac37f230ae52e0173b1 to your computer and use it in GitHub Desktop.
Save stefanoverna/50384c771d775ac37f230ae52e0173b1 to your computer and use it in GitHub Desktop.
sub vcl_hash {
#FASTLY hash
set req.hash += req.url;
set req.hash += req.http.host;
set req.hash += req.http.Authorization;
if (req.request == "POST" && req.postbody) {
set req.hash += req.postbody;
}
log {"syslog url"} req.url " host " req.http.host " authorization " req.http.Authorization " request " req.request " postbody " req.postbody;
return(hash);
}
sub vcl_fetch {
#FASTLY fetch
unset beresp.http.Cache-Control;
unset beresp.http.Etag;
}
sub vcl_recv {
#FASTLY recv
set req.http.host = "graphql.datocms.com";
if (req.request == "POST") {
return(lookup);
}
return(lookup);
}
sub vcl_deliver {
#FASTLY deliver
set resp.http.X-VLC-Version = "6";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment