From 385a4d8adfaa786e4b9f4cc51b34035fd1a3262d Mon Sep 17 00:00:00 2001 From: Tom Scavo Date: Tue, 2 May 2017 11:33:38 -0400 Subject: [PATCH] Capture the output of a fresh run --- README.md | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ebb5ae6..aeee1f2 100644 --- a/README.md +++ b/README.md @@ -69,10 +69,10 @@ Now GET the first resource: ```Shell $ $BIN_DIR/cget.sh $url1 > /dev/null -2017-05-02T13:24:57Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml -2017-05-02T13:26:11Z INFO conditional_get received response code: 200 -2017-05-02T13:26:11Z INFO conditional_get writing cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content -2017-05-02T13:26:12Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content +2017-05-02T15:29:35Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-05-02T15:29:41Z INFO conditional_get received response code: 200 +2017-05-02T15:29:41Z INFO conditional_get writing cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content +2017-05-02T15:29:41Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content $ echo $? 0 $ ls -1 $CACHE_DIR @@ -80,12 +80,12 @@ $ ls -1 $CACHE_DIR 1e6b844a49d1850b82feded72cf83ed7_headers $ cat $CACHE_DIR/1e6b844a49d1850b82feded72cf83ed7_headers HTTP/1.1 200 OK -Date: Wed, 26 Apr 2017 16:29:44 GMT +Date: Tue, 02 May 2017 15:29:34 GMT Server: Apache -Last-Modified: Tue, 25 Apr 2017 19:14:05 GMT -ETag: "299866f-54e0286fb789a" +Last-Modified: Mon, 01 May 2017 19:02:13 GMT +ETag: "29bcdb4-54e7b0fa340c5" Accept-Ranges: bytes -Content-Length: 43615855 +Content-Length: 43765172 Content-Type: application/samlmetadata+xml ``` @@ -93,8 +93,8 @@ Assuming the resource doesn't change on the server, subsequent requests will ret ```Shell $ $BIN_DIR/cget.sh -C $url1 | wc -c -2017-05-02T13:27:07Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml -2017-05-02T13:27:07Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content +2017-05-02T15:30:39Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-05-02T15:30:39Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content 43765172 ``` @@ -103,8 +103,8 @@ 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 +2017-05-02T15:31:07Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-05-02T15:31:07Z ERROR conditional_get: resource not cached: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml $ echo $? 1 ``` @@ -114,9 +114,9 @@ OTOH, the ``-F`` option forces the return of a fresh resource from the server. I ```Shell # 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 +2017-05-02T15:31:42Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-05-02T15:31:48Z INFO conditional_get received response code: 304 +2017-05-02T15:31:48Z ERROR conditional_get: resource not modified: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml $ echo $? 1 ``` @@ -125,10 +125,10 @@ 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 +2017-05-02T15:32:27Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-05-02T15:32:32Z INFO conditional_get received response code: 200 +2017-05-02T15:32:32Z INFO conditional_get writing cached content file: /tmp/http_cache/1727196e5b7593f3b7528c539e7169d2_content +2017-05-02T15:32:32Z INFO conditional_get reading cached content file: /tmp/http_cache/1727196e5b7593f3b7528c539e7169d2_content $ echo $? 0 $ ls -1 $CACHE_DIR @@ -136,6 +136,15 @@ $ ls -1 $CACHE_DIR 1727196e5b7593f3b7528c539e7169d2_headers 1e6b844a49d1850b82feded72cf83ed7_content 1e6b844a49d1850b82feded72cf83ed7_headers +$ cat $CACHE_DIR/1727196e5b7593f3b7528c539e7169d2_headers +HTTP/1.1 200 OK +Date: Tue, 02 May 2017 15:32:26 GMT +Server: Apache +Last-Modified: Mon, 01 May 2017 19:02:13 GMT +ETag: "29bcdb4-54e7b0fa246c3" +Accept-Ranges: bytes +Content-Length: 43765172 +Content-Type: application/samlmetadata+xml ``` See the inline help file for details: