https://bugzilla.novell.com/show_bug.cgi?id=307098#c10
Peter Poeml changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |ASSIGNED
Info Provider|poeml@novell.com |
--- Comment #10 from Peter Poeml 2007-09-05 00:16:46 MST ---
Don't look before you leap...!
HEAD request? Why check at all? Is it not useful in this scenario to do
two requests, if you can do one. If the request fails, you'll get a 404.
If it succeeds, you have the file.
And if you _need_ to check for the existance of a _large_ file which you
_don't_ want to download:
HTTP:
a HEAD request is preferable to a 2-byte partial GET.
FTP:
FTP is ineffective as protocol for us anyway because it doesn't have
any cache control, which renders the protocol unusable for
buildservice repositories. Secondly, we don't run an FTP server
ourselves. So I care less. But FTP has commands like
LIST <file> # return information about file, if it exists
MDTM <file> # return last-modified time of a file
SIZE <file> # return size
MDTM must be announced in the FTP server features, but LIST is always
there.
But normally, don't look before you leap.
Two notes:
1) ...checking Last-modified and size is principally a good idea, before
re-downloading a file. However, repomd.xml is a special case because it
is only a kilobyte and already contains hashes for all other potentially
needed files. Thus, it makes the check on the other files and is a real
saver.
2) if you ever need to re-download for a file, do it the right way and
make it a conditional GET, so you need only one request as well -- with
If-Modified-Since header (rfc2616 14.25).
With libcurl, you have the most capable library on-hand :-)
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.