git/list[1] front-page[2] threads[3] people[4] search[5] about
 

GitWeb caching of snapshots

From
JTJanus Troelsen <ysangkok@gmail.com>
Date
Jan 16, 2015, 00:13 UTC
Message-ID
<CAKBpzh=eW0zejHktsb+YTPnqcqd_KSR3VL0xQ0+-033Q9b2pCA@mail.gmail.com>
Hi,

I noticed that GitWeb caches based on the "Last-Modified" header. Won't this break if somebody force pushes a branch with the new newest commit being older than the previous? The modification date will be older, which makes little sense to HTTP clients, and it would probably break since they use the "If-Modified-Since" header.

Wouldn't it make more sense to use the commit ID as an ETag? This would avoid this bug. Two different archive types would get the same ETag even if the HTTP content body is not equal, but I think this is not in violation of the HTTP standard, since caching is based on URL's AND ETags.

Here's a link to git_snapshot which is the relevant function: http://git.kernel.org/cgit/git/git.git/tree/gitweb/gitweb.perl#n7314

Looking forward to your feedback.

Regards, Janus

Message 1 of 1 in “GitWeb caching of snapshots”
  1. Janus TroelsenJan 16, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.