<div dir="ltr"><div>Hello,</div><div><br></div><div>I am trying to cache Github zip URL's so it can be effectively cached as a composer(php dependency management tool) uses them and in our local setup ( we are about 40 developers on a Lan and it will really help us managing cache.). My squid version is 3.5.12 and our squid cache server is ubuntu 16.04. Here is squid.conf file we use,</div><div><a href="https://gist.github.com/hardikdangar/df31d5bce725eff66e06f3abd6e77600">https://gist.github.com/<wbr>hardikdangar/<wbr>df31d5bce725eff66e06f3abd6e776<wbr>00</a></div><div><br></div><div>Here is the part which I want to cache,</div><div>say for example you want to download repo from GitHub then URL looks like</div><div><a href="https://github.com/hardikdangar/test/archive/master.zip">https://github.com/<wbr>hardikdangar/test/archive/<wbr>master.zip</a></div><div>but it redirects to the following,</div><div><a href="https://codeload.github.com/hardikdangar/test/zip/master">https://codeload.github.com/<wbr>hardikdangar/test/zip/master</a></div><div><br></div><div>You can see the response parameters via <a href="http://redbot.org">redbot.org</a></div><div><a href="https://redbot.org/?uri=https%3A%2F%2Fcodeload.github.com%2Fhardikdangar%2Ftest%2Fzip%2Fmaster">https://redbot.org/?uri=https%<wbr>3A%2F%2Fcodeload.github.com%<wbr>2Fhardikdangar%2Ftest%2Fzip%<wbr>2Fmaster</a></div><div><br></div><div>  HTTP/1.1 200 OK</div><div>    Content-Length: 929</div><div>    Access-Control-Allow-Origin: <a href="https://render.githubusercontent.com">https://render.<wbr>githubusercontent.com</a></div><div>    Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'</div><div>    Strict-Transport-Security: max-age=31536000</div><div>    Vary: Authorization,Accept-Encoding</div><div>    X-Content-Type-Options: nosniff</div><div>    X-Frame-Options: deny</div><div>    X-XSS-Protection: 1; mode=block</div><div>    ETag: "<wbr>9ea9838812d6f7bc53763eb1577da0<wbr>4e2fa473d5"</div><div>    Content-Type: application/zip</div><div>    Content-Disposition: attachment; filename=test-master.zip</div><div>    X-Geo-Block-List:</div><div>    Date: Wed, 14 Sep 2016 23:24:44 GMT</div><div>    X-GitHub-Request-Id: 77092BF1:7F40:346461:57D9DC3C</div><div><br></div><div>Now if i do any change to above repository github does change ETAG and if i don't change anything then ETAG remains the same so i believe we should be able to cache those .zip files.</div><div><br></div><div>By default, squid does not cache <a href="http://codeload.github.com">codeload.github.com</a>, to put it into cache, I added,</div><div>refresh_pattern <a href="http://codeload.github.com">codeload.github.com</a> 900 20% 4320 reload-into-ims</div><div><br></div><div>Now as per my understanding this should check etag as Last-Modified is not provided by github for each new request. This does cache the zip file but what happens is in next request even if i change the content and etag changes squid sends the cached file from its cache instead of downloading new file.</div><div><br></div><div>I have no clue why this happens. Can anyone help me figure out what's wrong here? why squid does not detect new etag when repository is updated? why it sends cache file even though there is new file available.</div><div><br></div><div>Thank you very much in advance for reading upto this point and have a good day. </div>
</div>