diff --git a/README.md b/README.md index f4bd9c5..cf4920f 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ $ echo $? $ ls -1 $CACHE_DIR 1e6b844a49d1850b82feded72cf83ed7_content 1e6b844a49d1850b82feded72cf83ed7_headers -cget_log.txt $ cat $CACHE_DIR/1e6b844a49d1850b82feded72cf83ed7_headers HTTP/1.1 200 OK Date: Wed, 26 Apr 2017 16:29:44 GMT @@ -93,29 +92,32 @@ Of course the ``-C`` option will fail if the resource is not cached: ```Shell # illustrate "quiet failure mode" $ $BIN_DIR/cget.sh -C $url2 +2017-05-02T14:53:38Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-05-02T14:53:38Z ERROR conditional_get: resource not cached: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml $ echo $? 1 -$ cat $CACHE_DIR/cget_log.txt | tail -n 2 -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: ```Shell -# again illustrate "quiet failure mode" +# further illustrate "quiet failure mode" $ $BIN_DIR/cget.sh -F $url1 +2017-05-02T14:54:37Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-05-02T14:54:38Z INFO conditional_get received response code: 304 +2017-05-02T14:54:38Z ERROR conditional_get: resource not modified: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml $ echo $? 1 -$ cat $CACHE_DIR/cget_log.txt | tail -n 2 -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: ```Shell $ $BIN_DIR/cget.sh -F $url2 > /dev/null +2017-05-02T14:55:24Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-05-02T14:55:30Z INFO conditional_get received response code: 200 +2017-05-02T14:55:30Z INFO conditional_get writing cached content file: /tmp/http_cache/1727196e5b7593f3b7528c539e7169d2_content +2017-05-02T14:55:30Z INFO conditional_get reading cached content file: /tmp/http_cache/1727196e5b7593f3b7528c539e7169d2_content $ echo $? 0 $ ls -1 $CACHE_DIR