varnish content length replaced
Viktor Villafuerte
viktor.villafuerte at optusnet.com.au
Tue May 19 01:22:56 CEST 2015
Hi,
On Sat 16 May 2015 15:19:07, Dridi Boukelmoune wrote:
> Hi,
>
> Could you please send enough VCL to reproduce?
>
> Please find below (and attached) a test case that doesn't reproduce
> your issue. Since I only had the backend request, I inferred the
> client request from it. As you can see, Varnish 4 (4.0.3 on my
> machine) built-in VCL does nothing by default.
>
> --->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8---
> server s1 {
> rxreq
> txresp -hdr "Server: Apache" \
> -hdr {P3P: CP="ALL DSP COR LAW CUR DEVi TAI PSAi PSD
> IVA IVD CONo HIS TELo OUR DEL SAM BUS LOC"
> policyref="http://xxx.domain.com/w3c/p3p.xml"} \
> -hdr "Last-Modified: Wed, 06 May 2015 06:54:03 GMT" \
> -hdr "Accept-Ranges: bytes" \
> -hdr "Content-Type: application/font-woff" \
> -bodylen 25008
> } -start
>
> varnish v1 -vcl+backend {
> # built-in VCL
> } -start
>
> client c1 {
> txreq -url "/ajaxprism/js_jq_1_0/css/fonts/roboto-regular-webfont.woff" \
> -hdr "Accept: application/font-woff;q=0.9,*/*;q=0.8" \
> -hdr "Accept-Language: en-US,en;q=0.5" \
> -hdr "Origin: http://xxx.domain.com" \
> -hdr "Pragma: no-cache" \
> -hdr "Referer:http://xxx.domain.com/ajaxprism/js_jq_1_0/css/style_2.css"\
> -hdr {User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:37.0) Gecko/20100101
> Firefox/37.0} \
> -hdr "host: xxx.domain.com" \
> -hdr "Accept-Encoding: gzip"
> rxresp
> expect resp.http.content-length != <undef>
> expect resp.http.content-length == "25008"
> } -run
> --->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8---
>
> I also don't understand how it's a problem to not have a C-L header
> for chunked encoding.
I think what's Anand says it's not that he's missing C-L header but that
Varnish adds it by itself..
http://stackoverflow.com/questions/23643233/how-do-i-disable-transfer-encoding-chunked-encoding-in-varnish
this worked for me - see the last post and 'do_esi' setting.
thanks
v
>
> Regards,
> Dridi
>
> On Thu, May 7, 2015 at 8:31 AM, Anand Shah <anand at rediff-inc.com> wrote:
> > Hello,
> >
> >
> > Using Varnish 4, I have a set of backends that're responding with a valid
> > Content-Length header and no Transfer-Encoding header. On the first hit from
> > a client, rather than responding to the client with those headers, Varnish
> > is dropping the Content-Length header and adding Transfer-Encoding: chunked
> > to the response. This is especially happening for fonts. The same data when
> > fetched from apache and nginx works like a charm and continue to be
> > problematic when used varnish in front.
> >
> > I've tried a number of semi-obvious things like below but all in vain:
> >
> > beresp.do_stream = true
> > beresp.do_gzip = false
> > unset req.http.Accept-Encoding
> >
> >
> > Sample varnishlog <backend> for your reference.
> >
> >
> >
> > * << BeReq >> 247282680
> > - Begin bereq 247282679 fetch
> > - Timestamp Start: 1430979942.850688 0.000000 0.000000
> > - BereqMethod GET
> > - BereqURL
> > /ajaxprism/js_jq_1_0/css/fonts/roboto-regular-webfont.woff
> > - BereqProtocol HTTP/1.1
> > - BereqHeader Accept: application/font-woff;q=0.9,*/*;q=0.8
> > - BereqHeader Accept-Language: en-US,en;q=0.5
> > - BereqHeader Origin: http://xxx.domain.com
> > - BereqHeader Pragma: no-cache
> > - BereqHeader Referer:
> > http://xxx.domain.com/ajaxprism/js_jq_1_0/css/style_2.css
> > - BereqHeader User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:37.0)
> > Gecko/20100101 Firefox/37.0
> > - BereqHeader X-Forwarded-For: ::1
> > - BereqHeader host: xxx.domain.com
> > - BereqHeader Accept-Encoding: gzip
> > - BereqHeader X-Varnish: 247282680
> > - VCL_call BACKEND_FETCH
> > - VCL_return fetch
> > - BackendClose 24 jdelivery(xxx.xxx.xxx.xxx,,80) toolate
> > - BackendOpen 24 jdelivery(xxx.xxx.xxx.xxx,,80) xxx.xxx.xxx.xxx 35680
> > - Backend 24 jdelivery jdelivery(xxx.xxx.xxx.xxx,,80)
> > - Timestamp Bereq: 1430979942.852142 0.001454 0.001454
> > - Timestamp Beresp: 1430979942.855756 0.005068 0.003614
> > - BerespProtocol HTTP/1.1
> > - BerespStatus 200
> > - BerespReason OK
> > - BerespHeader Date: Thu, 07 May 2015 06:25:43 GMT
> > - BerespHeader Server: Apache
> > - BerespHeader P3P: CP="ALL DSP COR LAW CUR DEVi TAI PSAi PSD IVA IVD
> > CONo HIS TELo OUR DEL SAM BUS LOC"
> > policyref="http://xxx.domain.com/w3c/p3p.xml"
> > - BerespHeader Last-Modified: Wed, 06 May 2015 06:54:03 GMT
> > - BerespHeader Accept-Ranges: bytes
> > - BerespHeader Content-Length: 25008
> > - BerespHeader Content-Type: application/font-woff
> > - TTL RFC 120 -1 -1 1430979943 1430979943 1430979943 0 0
> > - VCL_call BACKEND_RESPONSE
> > - TTL VCL 120 604800 0 1430979943
> > - VCL_return deliver
> > - Storage file s0
> > - ObjProtocol HTTP/1.1
> > - ObjStatus 200
> > - ObjReason OK
> > - ObjHeader Date: Thu, 07 May 2015 06:25:43 GMT
> > - ObjHeader Server: Apache
> > - ObjHeader P3P: CP="ALL DSP COR LAW CUR DEVi TAI PSAi PSD IVA IVD
> > CONo HIS TELo OUR DEL SAM BUS LOC"
> > policyref="http://xxx.domain.com/w3c/p3p.xml"
> > - ObjHeader Last-Modified: Wed, 06 May 2015 06:54:03 GMT
> > - ObjHeader Content-Type: application/font-woff
> > - Fetch_Body 3 length stream
> > - BackendReuse 24 jdelivery(xxx.xxx.xxx.xxx,,80)
> > - Timestamp BerespBody: 1430979942.859386 0.008698 0.003630
> > - Length 25008
> > - BereqAcct 449 0 449 337 25008 25345
> > - End
> >
> >
> > Regards,
> > Anand
> > _______________________________________________
> > varnish-dev mailing list
> > varnish-dev at varnish-cache.org
> > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
--
Regards
Viktor Villafuerte
Optus Internet Engineering
t: 02 808-25265
More information about the varnish-misc
mailing list