Skip to content

Commit

Permalink
Update example in overview section
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Scavo authored Apr 26, 2017
1 parent 26311ac commit 7aecf7a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 7aecf7a

Please sign in to comment.