git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sf <sf@b-i-t.de>
To: git@vger.kernel.org
Subject: Re: [PATCH] git-http-fetch: Allow caching of retrieved objects   byproxy servers
Date: Mon, 19 Sep 2005 12:24:45 +0200	[thread overview]
Message-ID: <432E91ED.7050605@b-i-t.de> (raw)
In-Reply-To: <Pine.LNX.4.62.0509181720290.14003@qynat.qvtvafvgr.pbz>

David Lang wrote:
> 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

  reply	other threads:[~2005-09-19 11:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 15:38 [PATCH] git-http-fetch: Allow caching of retrieved objects by proxy servers Sergey Vlasov
2005-09-13 15:59 ` Junio C Hamano
2005-09-14 13:12   ` Sergey Vlasov
2005-09-14 16:28     ` Junio C Hamano
2005-09-14 17:17 ` sf
2005-09-19  0:23   ` [PATCH] git-http-fetch: Allow caching of retrieved objects byproxy servers David Lang
2005-09-19 10:24     ` sf [this message]
2005-09-19 13:35       ` Petr Baudis
2005-09-20 11:34         ` sf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=432E91ED.7050605@b-i-t.de \
    --to=sf@b-i-t.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).