<div dir="ltr">Hi,<div><br></div><div>first of all, a shout out to all ZuriHac2014 folks, thanks for the gentle introduction to the deeper trenches of Haskell infrastructure!</div><div><br></div><div>I spent a bit of time looking into why "cabal update" always redownloads the entire package list even though the code has explicit support for etags, and it looks like etags are broken on the server side. The server does serve "Etag" headers, but does not react to If-None-Match:</div>

<div><br></div><div><div>$ curl -I --header 'If-None-Match: "1ea6c9a3168b9c186d5bbafd065ce5ec"' <a href="http://hackage.haskell.org/packages/index.tar.gz">hackage.haskell.org/packages/index.tar.gz</a></div>

<div>HTTP/1.1 200 OK</div><div>Server: nginx/1.6.0</div><div>Date: Mon, 09 Jun 2014 23:22:49 GMT</div><div>Content-Type: application/x-gzip</div><div>Content-Length: 7193838</div><div>Connection: keep-alive</div><div>Content-MD5: 1ea6c9a3168b9c186d5bbafd065ce5ec</div>

<div>ETag: "1ea6c9a3168b9c186d5bbafd065ce5ec"</div><div>Last-modified: Mon, 09 Jun 2014 23:10:44 GMT</div><div><br></div><div>In this case the server is supposed to return a 304 code because the ETag matches, but it returns the usual 200.<br>

</div><div><br></div><div>Here's a well-behaved server for comparison:</div><div><br></div><div><div>$ curl -I --header 'If-None-Match: f89ef04efbcb1bbd413c9170523beeb1' <a href="http://upload.wikimedia.org/">http://upload.wikimedia.org/</a></div>

<div>HTTP/1.1 304 Not Modified</div><div>Last-Modified: Thu, 03 Oct 2013 22:29:34 GMT</div><div>Etag: f89ef04efbcb1bbd413c9170523beeb1</div><div>X-Timestamp: 1380839374.33426</div><div>X-Object-Meta-Mtime: 1366745378.0</div>

<div>Content-Type: text/html</div><div>X-Varnish: 2552484147 2541352860, 2937266545 2853346814, 523731362</div><div>Via: 1.1 varnish, 1.1 varnish, 1.1 varnish</div><div>Accept-Ranges: bytes</div><div>Date: Mon, 09 Jun 2014 23:29:36 GMT</div>

<div>Age: 38954</div><div>Connection: keep-alive</div><div>X-Cache: cp1064 hit (336), cp3010 hit (1791), cp3007 frontend miss (0)</div><div>Access-Control-Allow-Origin: *</div><div>Access-Control-Expose-Headers: Age, Content-Length, Date, X-Cache, X-Varnish</div>

</div><div><br></div><div>Note the 304 return code.</div><div><br></div><div>I do not know about the configuration in use on the server, but something seems to be wrong there. There are some nginx bug reports [1] about similar issues, not sure if they are relevant here.</div>

<div><br></div><div>[1] <a href="https://github.com/rgrove/rawgit/issues/13">https://github.com/rgrove/rawgit/issues/13</a></div><div><br></div><div>Best regards,</div>-- <br>Gintautas Miliauskas

</div></div>