Content-Length on first fetch, Varnish 4

Robin imer at imer.cc
Wed Jul 23 02:35:22 CEST 2014


Like this question asks 
http://stackoverflow.com/questions/23643233/how-do-i-disable-transfer-encoding-chunked-encoding-in-varnish

We have some code in place that relies on having a content-length header 
to display a progress bar, we have patched this code, but to deliver 
it.. well, we have to let it download the new binary.
I have tried to just set streaming to false for the binary
> sub vcl_backend_response {
>     if (bereq.url ~ "\.exe$") {
>         set beresp.do_stream = false;
>     }
>     set beresp.do_gzip = false;
> }
And while it seems to set streaming to false (requests loads for 10-20s 
to retrieve to binary completely) it doesnt have a content-length header 
the first time.
The suggested esi-processing doesnt work either (streaming true and false)
Is there any workaround I could use?

I have also seen there are some patches in the works to make use of the 
content-length header from the backend, does anyone know what the 
current state on that is?



More information about the varnish-misc mailing list