...
Code Block |
---|
|
$ MD_LOCATION=http://md.incommon.org/InCommon/InCommon-metadata.xml
$ /usr/bin/curl --silent --head $MD_LOCATION
HTTP/1.1 200 OK
Date: SunTue, 1930 JanDec 2014 1519:5725:4439 GMT
Server: Apache
Last-Modified: FriMon, 1729 JanDec 2014 20:1024:5124 GMT
ETag: "110328-87a649b28945-4f0302377e8c050b60a9050e00"
Accept-Ranges: bytes
Content-Length: 888992911700549
Connection: close
Content-Type: application/samlmetadata+xml
|
...
Code Block |
---|
|
$ /usr/bin/curl --silent --head $MD_LOCATION \
--header 'If-Modified-Since: FriMon, 1729 JanDec 2014 20:1024:5124 GMT'
HTTP/1.1 304 Not Modified
Date: SunTue, 1930 JanDec 2014 1619:0226:3320 GMT
Server: Apache
Connection: close
ETag: "110328-87a649b28945-4f0302377e8c050b60a9050e00"
|
Similarly, if we take the value of the ETag
header from the previous response as the value of the If-None-Match
header in the following request, we again receive a 304 response:
Code Block |
---|
|
$ /usr/bin/curl --silent --head $MD_LOCATION \
--header 'If-None-Match: "110328-87a649b28945-4f0302377e8c050b60a9050e00"'
HTTP/1.1 304 Not Modified
Date: SunTue, 1930 JanDec 2014 1619:0426:3158 GMT
Server: Apache
Connection: close
ETag: "110328-87a649b28945-4f0302377e8c050b60a9050e00"
|
The use of conditional GET has significant benefits, on both the client and the server (and the intervening network as well). On the metadata server, roughly 3/4 of all metadata requests result in HTTP 304. That translates into more than 15K many thousands of metadata requests per day that conveniently avoid the unnecessary overhead of metadata refresh. For a file whose size is more than 8MB 11MB and growing, that represents a significant cost savings.
...