Created
July 3, 2018 19:48
-
-
Save rezan/fa81dfb954c0397b0ce35c34dcadef64 to your computer and use it in GitHub Desktop.
Aggregate response headers and body into a single response block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vcl 4.0; | |
| # If you set req.http.X-aggregate = "true", Varnish will aggregate | |
| # the headers and response body into a single response block | |
| # Point this back to Varnish | |
| #backend loop { | |
| # .host = "127.0.0.1"; | |
| # .port = "80"; | |
| #} | |
| sub vcl_recv { | |
| if (req.http.X-aggregating == "true") { | |
| return (pass); | |
| } | |
| } | |
| sub vcl_backend_fetch { | |
| if (bereq.http.X-aggregate == "true" && !bereq.http.X-aggregating) { | |
| set bereq.http.X-aggregating = "true"; | |
| set bereq.backend = loop; | |
| } | |
| } | |
| sub vcl_backend_response { | |
| if (bereq.http.X-aggregating == "true") { | |
| set beresp.do_stream = false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment