[tz] FW: Beginner's help request
Paul Eggert
eggert at cs.ucla.edu
Wed Nov 22 08:17:07 UTC 2017
Daniel Ford wrote:
> Paul mentioned 'get the Last-Modified: header', but
> I'm not sure what that is and how my server would get it.
That's standardized here:
https://tools.ietf.org/html/rfc7232#section-2.2
For example, on my Fedora 27 host, I can run the following two shell commands:
wget -S https://www.iana.org/time-zones/repository/tzdb/tzdata.zi
wget -N -S https://www.iana.org/time-zones/repository/tzdb/tzdata.zi
and observe the attached transcript. The "Last-Modified:" header is one of the
HTTP headers I get back from the first "wget". The second "wget" uses a
conditional get, and gets a "304 Not Modified" response which means the local
copy of tzdata.zi is already up-to-date, and need not be refetched.
Say, it looks like the data.iana.org redirects are working! That's new. And
these servers support the "Etag:" header, which is better than "Last-Modified:"
in some ways. So it looks like you should be using "Etag:" instead of
"Last-Modified:", as described here:
https://tools.ietf.org/html/rfc7232#section-2.3
-------------- next part --------------
1003-Penguin $ wget -S https://www.iana.org/time-zones/repository/tzdb/tzdata.zi
--2017-11-21 20:05:02-- https://www.iana.org/time-zones/repository/tzdb/tzdata.zi
Resolving www.iana.org (www.iana.org)... 192.0.47.8, 2620:0:2830:200::8
Connecting to www.iana.org (www.iana.org)|192.0.47.8|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 302 FOUND
Date: Wed, 22 Nov 2017 04:04:53 GMT
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: upgrade-insecure-requests
Location: https://data.iana.org/time-zones/tzdb/tzdata.zi
Cache-Control: public, s-maxage=600, max-age=3600
Expires: Wed, 22 Nov 2017 05:04:53 GMT
Content-Length: 0
Content-Type: text/html; charset=utf-8
Server: Apache
Strict-Transport-Security: max-age=48211200; preload
X-Cache-Hits: 1
Connection: keep-alive
Location: https://data.iana.org/time-zones/tzdb/tzdata.zi [following]
--2017-11-21 20:05:02-- https://data.iana.org/time-zones/tzdb/tzdata.zi
Resolving data.iana.org (data.iana.org)... 72.21.81.189, 2606:2800:11f:bb5:f27:227f:1bbf:a0e
Connecting to data.iana.org (data.iana.org)|72.21.81.189|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Content-Encoding: gzip
Cache-Control: max-age=86400
Content-Type: text/plain; charset=UTF-8
Date: Wed, 22 Nov 2017 04:05:03 GMT
Etag: "19f8a-55c3858b90e00+gzip"
Expires: Thu, 23 Nov 2017 04:05:03 GMT
Last-Modified: Mon, 23 Oct 2017 15:19:20 GMT
Server: ECAcc (laa/7BAC)
Strict-Transport-Security: max-age=48211200; preload
Vary: Accept-Encoding
X-Cache: HIT
X-Frame-Options: SAMEORIGIN
Content-Length: 25895
Length: 25895 (25K) [text/plain]
Saving to: тАШtzdata.ziтАЩ
tzdata.zi 100%[===================>] 25.29K --.-KB/s in 0.001s
2017-11-21 20:05:03 (26.4 MB/s) - тАШtzdata.ziтАЩ saved [106378]
1004-Penguin $ wget -S -N https://www.iana.org/time-zones/repository/tzdb/tzdata.zi
--2017-11-21 20:07:39-- https://www.iana.org/time-zones/repository/tzdb/tzdata.zi
Resolving www.iana.org (www.iana.org)... 192.0.47.8, 2620:0:2830:200::8
Connecting to www.iana.org (www.iana.org)|192.0.47.8|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 302 FOUND
Date: Wed, 22 Nov 2017 04:07:40 GMT
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: upgrade-insecure-requests
Location: https://data.iana.org/time-zones/tzdb/tzdata.zi
Cache-Control: public, s-maxage=600, max-age=3600
Expires: Wed, 22 Nov 2017 05:07:40 GMT
Content-Length: 0
Content-Type: text/html; charset=utf-8
Server: Apache
Strict-Transport-Security: max-age=48211200; preload
X-Cache-Hits: 0
Connection: keep-alive
Location: https://data.iana.org/time-zones/tzdb/tzdata.zi [following]
--2017-11-21 20:07:40-- https://data.iana.org/time-zones/tzdb/tzdata.zi
Resolving data.iana.org (data.iana.org)... 72.21.81.189, 2606:2800:11f:bb5:f27:227f:1bbf:a0e
Connecting to data.iana.org (data.iana.org)|72.21.81.189|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 304 Not Modified
Cache-Control: max-age=86400
Date: Wed, 22 Nov 2017 04:07:40 GMT
Etag: "19f8a-55c3858b90e00+gzip"
Expires: Thu, 23 Nov 2017 04:07:40 GMT
Last-Modified: Mon, 23 Oct 2017 15:19:20 GMT
Server: ECAcc (laa/7BAC)
Strict-Transport-Security: max-age=48211200; preload
Vary: Accept-Encoding
X-Cache: HIT
X-Frame-Options: SAMEORIGIN
File тАШtzdata.ziтАЩ not modified on server. Omitting download.
More information about the tz
mailing list