<div dir="ltr"><div>Hello everyone,</div><div> My varnish version is 3.0.2-streaming release.And I set "beresp.do_stream = true" in vcl_fetch in order to "Deliver the object to the client directly without fetching the whole object into varnish";</div>
<div><br></div><div>This is a part of my *.vcl file:</div><div><br></div><div> sub vcl_fetch {</div><div> set beresp.grace = 30m;</div><div><br></div><div> set beresp.do_stream = true;</div><div><br></div><div> if (beresp.http.Content-Length && beresp.http.Content-Length ~ "[0-9]{8,}") {</div>
<div> return (hit_for_pass);</div><div> }</div><div><br></div><div> if (beresp.http.Pragma ~ "no-cache" || beresp.http.Cache-Control ~ "no-cache" || beresp.http.Cache-Control ~ "private") {</div>
<div> return (hit_for_pass);</div><div> }</div><div><br></div><div> if (beresp.ttl <= 0s ||</div><div> beresp.http.Set-Cookie ||</div><div> beresp.http.Vary == "*") {</div>
<div><br></div><div> set beresp.ttl = 120 s;</div><div> return (hit_for_pass);</div><div> }</div><div><br></div><div> return (deliver);</div><div> }</div><div><br></div><div>Then I request a big file(about 100M+) like "xxx.zip" from clients.There is only one client can access the object.because "the object will marked as busy as it is delivered."</div>
<div><br></div><div>But if the request goes directly to “pass” ,multiple clients can get the response at the same time.</div><div><br></div><div>Also if I remove </div><div> if (beresp.http.Content-Length && beresp.http.Content-Length ~ "[0-9]{8,}") {</div>
<div> return (hit_for_pass);</div><div> }</div><div>to make the file cacheable,multiple clients can get the response at the same time.</div><div><br></div><div>Now I want "multiple clients can get the response at the same time." in all situations("pass","hit","hit_for_pass"). </div>
<div><br></div><div>What can I do for it?</div><div style>Any suggestions will be appreciate.</div><div style>Thank you.</div><div style> </div><div style> -Shawn Wang</div><div><br></div></div>