{"thread":{"id":"38380","subject":"GitWeb caching of snapshots","startedAt":"2015-01-16T00:13:37Z","lastAt":"2015-01-16T00:13:37Z","messageCount":1,"participants":["Janus Troelsen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"254797","messageId":"CAKBpzh=eW0zejHktsb+YTPnqcqd_KSR3VL0xQ0+-033Q9b2pCA@mail.gmail.com","threadId":"38380","inReplyTo":null,"subject":"GitWeb caching of snapshots","fromName":"Janus Troelsen","fromEmail":"ysangkok@gmail.com","sentAt":"2015-01-16T00:13:37Z","receivedAt":"2015-01-16T00:13:37Z","isPatch":false,"sender":{"key":"ysangkok@gmail.com","avatar":null},"body":"Hi,\n\nI noticed that GitWeb caches based on the \"Last-Modified\" header.\nWon't this break if somebody force pushes a branch with the new newest\ncommit being older than the previous? The modification date will be\nolder, which makes little sense to HTTP clients, and it would probably\nbreak since they use the \"If-Modified-Since\" header.\n\nWouldn't it make more sense to use the commit ID as an ETag? This\nwould avoid this bug. Two different archive types would get the same\nETag even if the HTTP content body is not equal, but I think this is\nnot in violation of the HTTP standard, since caching is based on URL's\nAND ETags.\n\nHere's a link to git_snapshot which is the relevant function:\nhttp://git.kernel.org/cgit/git/git.git/tree/gitweb/gitweb.perl#n7314\n\nLooking forward to your feedback.\n\nRegards,\nJanus\n"}]}