<div dir="ltr">Thanks Zhang and Maxim!<div><br></div><div>I'm checking how to fix that on my backend. </div><div><br></div><div>Kind,</div><div>NM</div><div class="gmail_extra">
<br><div class="gmail_quote">2017-07-04 9:21 GMT-03:00 Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<span class=""><br>
On Mon, Jul 03, 2017 at 05:09:28PM -0300, Nelson Marcos wrote:<br>
<br>
> I don't know if it is an expected behaviour or a bug:<br>
><br>
><br>
</span>> Scenario 1(OK): If I perform a request *with the header Range*,  Nginx<br>
> serves the *partial content(HTTP 206)*.<br>
><br>
> Scenario 2 (NOT OK): If I perform a request *with the header Range AND the<br>
> header "If-Range" *with the Etag, Nginx serves the *entire file*(200). Why<br>
<span class="">> not serve the partial content if its cached version matches the If-Range<br>
> header?<br>
><br>
> In both scenarios the file is already cached.<br>
><br>
> Here is my conf: <a href="https://pastebin.com/gQQ0GSg6" rel="noreferrer" target="_blank">https://pastebin.com/gQQ0GSg6</a><br>
><br>
> Here are my requests and my files: <a href="https://pastebin.com/rxLwYaSK" rel="noreferrer" target="_blank">https://pastebin.com/rxLwYaSK</a><br>
<br>
</span>The "ETag" header in the response is invalid, as well as<br>
"If-Range" in the request.  Quoting from the second link:<br>
<br>
: Etag: 345a2dd5c8f22e9ffaf250151ea820<wbr>df<br>
: If-Range: 345a2dd5c8f22e9ffaf250151ea820<wbr>df<br>
<br>
In both cases entity tag should be in double quotes, see<br>
<a href="https://tools.ietf.org/html/rfc2616#section-14.19" rel="noreferrer" target="_blank">https://tools.ietf.org/html/<wbr>rfc2616#section-14.19</a>.<br>
<br>
Fixing your backend to return correct ETag will make things work.<br>
Alternatively, you can use Last-Modified date in the If-Range<br>
request header instead.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/" rel="noreferrer" target="_blank">http://nginx.org/</a><br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div></div>