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

Re: [PATCH] git-http-fetch: Allow caching of retrieved objects byproxy servers

From
Ssf <sf@b-i-t.de>
Date
Sep 19, 2005, 10:24 UTC
Message-ID
<432E91ED.7050605@b-i-t.de>
In-Reply-To
<Pine.LNX.4.62.0509181720290.14003@qynat.qvtvafvgr.pbz>
David Lang wrote:
Show 15 quoted lines
> On Wed, 14 Sep 2005, sf wrote:
> 
>> Sergey Vlasov wrote:
>>
>>> By default the curl library adds "Pragma: no-cache" header to all
>>> requests, which disables caching by proxy servers.  However, most
>>> files in a GIT repository are immutable, and caching them is safe and
>>> could be useful.
>>
>>
>> Is caching really safe? Because of compression one git object can have 
>> many file representations.
> 
> 
> only if you use different compression algorithums.

Even different implementations and different compression levels can lead to different file representations.

> remember that git objects are identified by their sha1, if the sha1 is 
> what you want (and the file matches the sha1 after you decompress it) 
> then it really doesn't matter what it's on-disk representation is.

You are arguing on the git tool level but we are talking about HTTP which knows nothing about the uncompressed sha1.

The OP assumed that "files in a GIT repository are immutable" which is not true. If you consider the sequence

pack -> prune -> update zlib or git -> unpack

you can end up with different files if the new zlib implementation changes imcompatibly (with respect to byte-by-byte compression results) or if git suddenly does not use the default compression level any more.

And surely in the future there will be other git implementations than this one which may not even use zlib.

I do not say that caching is not possible at all but HTTP caching has its pitfalls so just be careful.

Regards
	Stephan
Previous: David LangNext: Petr Baudis
Message 7 of 9 in “git-http-fetch: Allow caching of retrieved objects by proxy servers”
  1. git-http-fetch: Allow caching of retrieved objects by proxy serversSergey Vlasov, Sep 13, 2005
  2. Junio C HamanoSep 13, 2005
  3. Sergey VlasovSep 14, 2005
  4. Junio C HamanoSep 14, 2005
  5. sfSep 14, 2005
  6. David LangSep 19, 2005
  7. sfSep 19, 2005
  8. Petr BaudisSep 19, 2005
  9. sfSep 20, 2005

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.