diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2020-10-18 13:31:11 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2020-10-18 13:31:11 +0200 |
commit | 27a14a3d46603ab452dba10796a24591db096d76 (patch) | |
tree | 947585f2015210e6ed5b4e56c74aa48afecb7428 | |
parent | bffe41223467cb6d9a87c1a057966924fbda6c40 (diff) |
README: add example to support ETag caching
-rw-r--r-- | README | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -552,7 +552,7 @@ Now you can view feeds in mutt(1) for example. - - - -Incremental data updates +Incremental data updates using If-Modified-Since For servers that support it some incremental updates and bandwidth-saving can be done by using the "If-Modified-Since" HTTP header. @@ -573,6 +573,30 @@ vector of the local modification date of the feed file. - - - +Incremental data updates using ETag caching + +For servers that support it some incremental updates and bandwidth-saving can +be done by using the "ETag" HTTP header. + +Create a directory for storing the ETags per feed: + + mkdir -p ~/.sfeed/etags/ + +The curl ETag options can be used to send the previous ETag header value. You +can do this by overriding the fetch() function in the sfeedrc file and adding +the --etag-save and --etag-compare options: + + # fetch(name, url, feedfile) + fetch() { + etag="$HOME/.sfeed/etags/$1" + curl --etag-save "${etag}" --etag-compare "${etag}" "$2" + } + +This comes at a cost of some privacy. For example there can be a unique +generated ETag. + +- - - + CDN's blocking requests due to missing User-Agent sfeed_update will not send the "User-Agent" header by default for privacy |