On Tue, 29 Apr 2025, Aleksei wrote:

I'm asking for "and update the etag file" part to be done by curl.

Scenario:
1) curl downloads a webpage, saving etag file in file0.etag

Something like this:

curl --etag-save file0.etag $URL

2) website updates a webpage (update 1)
3) curl uses "--etag-compare file0.etag" and re-downloads the page -
  so far so good

Download the file if changed, update the etag file:

curl --etag-compare file0.etag --etag-save file0.etag $URL

4) website updates a webpage (update 2)
5) How do I check that webpage is updated now? "--etag-compare
  file0.etag" will re-download even if update 2 has been downloaded

You repeat the command above:

curl --etag-compare file0.etag --etag-save file0.etag $URL

... which only downloads the URL again if it is different than the last download.

--

 / daniel.haxx.se || https://rock-solid.curl.dev
--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to