summaryrefslogtreecommitdiff
path: root/guix/gnu-maintenance.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-09-19 11:49:29 +0200
committerLudovic Courtès <ludo@gnu.org>2017-09-19 12:19:15 +0200
commit3ce1b9021a1244063bf800e9d68763f12234edd5 (patch)
tree72275a651f8aaeac508c405a5287177f8d14f23f /guix/gnu-maintenance.scm
parent82781d871f8753737448c562b3906b2a7f89581c (diff)
downloadgnu-guix-3ce1b9021a1244063bf800e9d68763f12234edd5.tar
gnu-guix-3ce1b9021a1244063bf800e9d68763f12234edd5.tar.gz
http-client: 'http-client/cached' uses 'If-Modified-Since'.
* guix/http-client.scm (http-fetch/cached)[update-cache]: Add 'cache-port' parameter. Check its mtime and compute 'if-modified-since' header accordingly. Guard 'http-get-error?' and honor 304. Adjust callers of 'update-cache'. * guix/gnu-maintenance.scm (ftp.gnu.org-files): Set #:ttl to 15m.
Diffstat (limited to 'guix/gnu-maintenance.scm')
-rw-r--r--guix/gnu-maintenance.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 62f817347f..796c2d6569 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -454,7 +454,9 @@ hosted on ftp.gnu.org, or not under that name (this is the case for
(define (string->lines str)
(string-tokenize str (char-set-complement (char-set #\newline))))
- (let ((port (http-fetch/cached %gnu-file-list-uri #:ttl (* 60 60))))
+ ;; Since https://ftp.gnu.org honors 'If-Modified-Since', the hard-coded
+ ;; TTL can be relatively short.
+ (let ((port (http-fetch/cached %gnu-file-list-uri #:ttl (* 15 60))))
(map trim-leading-components
(call-with-gzip-input-port port
(compose string->lines get-string-all))))))