Quite often there is a need to fetch a new copy of a file only when the source file to be copied over has changed since the local version was last updated. To avoid an unnecessary fetch over http(s) it would be useful to add two new command line options to fetch. - One to specify the time to use in the if-modified-since header of the request directly from the command line. - Another to specify a reference file whose modify time to use as the content of the if-modified-since request header. None of this of course would work for ftp, but for http and https it would be a major benefit to be able to avoid pointless downloads when the local data is already as fresh as the data that would be pulled in. When fetching with http or https over a long distance connection the amount of time saved could be huge. Fix: The only known fix is to add the if-modified-since header and ability to parse to the potential "not modified" response. How-To-Repeat: Just copy a few large files over a long distance connection using fetch when your local copy is already as fresh as the one you receive, and you should instantly understand why I am proposing this.
Responsible Changed From-To: freebsd-bugs->des Over to fetch(1) maintainer
Jukka, if you are still interested in this, please try this patch against FreeBSD 6.4. Apply from /usr/src, then cd /usr/src/lib/libfetch; make all install; cd /usr/src/usr.bin/fetch; make all install http://people.freebsd.org/~murray/patches/fetch-if-modified-since-6.4.diff - Murray
State Changed From-To: open->patched This change has been committed to HEAD. Will MFC to 7.x after 7.1 is released.
Responsible Changed From-To: des->murray This change has been committed to HEAD. Will MFC to 7.x after 7.1 is released.
This has been merged to FreeBSD 7.x-STABLE. Will also merge it soon to 6.x. Murray
State Changed From-To: patched->closed Murray has returned his src bit for safekeeping. With the EOL of 6.x rapidly approaching, I'm just going to go ahead and close this with my bugmeister's hat on.