diff --git a/README.md b/README.md index 66db706..4deb2a1 100644 --- a/README.md +++ b/README.md @@ -74,10 +74,10 @@ Content-Length: 43615855 Content-Type: application/samlmetadata+xml $ cat $CACHE_DIR/cget_log.txt -2017-04-26T16:29:44Z cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml -2017-04-26T16:30:09Z conditional_get received response code: 200 -2017-04-26T16:30:10Z conditional_get writing cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content -2017-04-26T16:30:10Z conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content +2017-04-26T16:29:44Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-04-26T16:30:09Z INFO conditional_get received response code: 200 +2017-04-26T16:30:10Z INFO conditional_get writing cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content +2017-04-26T16:30:10Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content ``` Assuming the resource doesn't change on the server, subsequent requests will return the cached resource. To bypass the network altogether, use the ``-C`` option: @@ -95,8 +95,8 @@ $ $BIN_DIR/cget.sh -C $url2 $ echo $? 1 $ cat $CACHE_DIR/cget_log.txt | tail -n 2 -2017-04-26T16:39:38Z cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml -2017-04-26T16:39:38Z conditional_get: ERROR: resource not cached: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-04-26T16:39:38Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-04-26T16:39:38Z ERROR conditional_get: resource not cached: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml ``` OTOH, the ``-F`` option forces the return of a fresh resource from the server. If the resource is cached and unchanged on the server (304), such a request will fail, however: @@ -107,8 +107,8 @@ $ $BIN_DIR/cget.sh -F $url1 $ echo $? 1 $ cat $CACHE_DIR/cget_log.txt | tail -n 2 -2017-04-26T16:41:55Z conditional_get received response code: 304 -2017-04-26T16:41:55Z conditional_get: ERROR: resource not modified: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-04-26T16:41:55Z INFO conditional_get received response code: 304 +2017-04-26T16:41:55Z ERROR conditional_get: resource not modified: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml ``` The ``-F`` option will work on the other URL, however: