<div dir="ltr">Thank you for reply!<div>I still don't understand what's happening.</div><div>I create file 1.txt with a little bit of text data. Request it with curl. Web-server returns it without any cache related headers to squid, squid returns it to me. Getting it with curl one more time, squid serves it straight from cache without validation(no entries in log on origin server).</div><div>I create one more file 2.txt with some data. Do same things, same headers in response. Second response from squid is from cache but validated from origin server(i see 304 in origin server logs).</div><div>What could be wrong? </div><div>I have thought maybe squid applying heuristic freshness, but i didn't see any warnings in headers. </div><div>Maybe some sort of a bug?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 25, 2017 at 6:18 PM, Amos Jeffries <span dir="ltr"><<a href="mailto:squid3@treenet.co.nz" target="_blank">squid3@treenet.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 26/08/17 00:37, Alexander Lazarev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello guys!<br>
I'm using squid as a reverse-proxy. And I can't understand how squid decides when to check for fresh version of file from origin server.<br>
It looks like for some documents it sends 'If-Modified-Since' or similar headers and if it gets 304, it serves file from cache. And for some documents it doesn't check for fresh version and always serves from cache. > I was testing that with curl without any additional headers.<br>
Can some explain how that works or where I can read about that in detail?<br>
</blockquote>
<br></span>
The HTTP specification RFC 723x series was re-written to be a lot more easily understood, so those are probably the best place to read up about it.<br>
<br>
The features you are asking about are covered in:<br>
<br>
Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests<br>
 <<a href="https://tools.ietf.org/html/rfc7232" rel="noreferrer" target="_blank">https://tools.ietf.org/html/<wbr>rfc7232</a>><br>
<br>
Hypertext Transfer Protocol (HTTP/1.1): Caching<br>
 <<a href="https://tools.ietf.org/html/rfc7234" rel="noreferrer" target="_blank">https://tools.ietf.org/html/<wbr>rfc7234</a>><span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
And is it possible to make squid always check for fresh version before serving from cache?<br>
</blockquote>
<br></span>
It does when needed. The situation may be clearer after reading the above.<br>
<br>
Amos<br>
______________________________<wbr>_________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org" target="_blank">squid-users@lists.squid-cache.<wbr>org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer" target="_blank">http://lists.squid-cache.org/l<wbr>istinfo/squid-users</a><br>
</blockquote></div><br></div>