curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Naming ETag files?

From: Dan Fandrich via curl-users <curl-users_at_lists.haxx.se>
Date: Sun, 15 Jan 2023 12:47:48 -0800

On Sun, Jan 15, 2023 at 11:04:20AM -0700, Paul Gilmartin via curl-users wrote:
> Interesting. The Mac and Linux xattr commands have a useful compatible
> overlap. So I could download with:
> --etag-save tempfile.ETag
> tnen:
> xattr -w user.aETag "$( cat tempfile.ETag )" downloaded-resource
>
> ... and reverse the process for --etag-compare for the next conditional
> download.

But, ETags are unique to the server (or possibly the URL) so just saving the
ETag isn't enough. You'd have to also store the URL where it came from as well,
and only use the associated ETag if the server/URL matches on the next request.
curl actually save the URL already given the --xattr option.

Dan
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-01-15