Skip to content

Instantly share code, notes, and snippets.

@rezan
Created May 9, 2017 19:16
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 rezan/2b7d1cfa40f40688cfc200e77678c190 to your computer and use it in GitHub Desktop.
Save rezan/2b7d1cfa40f40688cfc200e77678c190 to your computer and use it in GitHub Desktop.
Content-Length on all responses, this requests and stores both gzip and non gzip responses natively
sub vcl_hash
{
if (req.url ~ "xxx") {
set req.http.X-Accept-Encoding = req.http.Accept-Encoding;
hash_data(req.http.Accept-Encoding);
}
}
sub vcl_backend_fetch
{
if (req.url ~ "xxx") {
set bereq.http.Accept-Encoding = bereq.http.X-Accept-Encoding;
}
}
sub vcl_backend_deliver
{
if (req.url ~ "xxx") {
set beresp.do_stream = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment