substitute: Honor 'Cache-Control' on 404 responses.

* guix/scripts/substitute.scm (cached-narinfo): When VALUE is #f, use
the TTL that is read instead of %NARINFO-NEGATIVE-TTL.
(cached-narinfo-expiration-time): Likewise.
master
Ludovic Courtès 2017-05-11 10:24:49 +02:00
parent 24b21720f7
commit 5db5dff53d
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 3 additions and 3 deletions

View File

@ -472,9 +472,9 @@ for PATH."
(match (read p)
(('narinfo ('version 2)
('cache-uri cache-uri)
('date date) ('ttl _) ('value #f))
('date date) ('ttl ttl) ('value #f))
;; A cached negative lookup.
(if (obsolete? date now %narinfo-negative-ttl)
(if (obsolete? date now ttl)
(values #f #f)
(values #t #f)))
(('narinfo ('version 2)
@ -722,7 +722,7 @@ was found."
(match (read port)
(('narinfo ('version 2) ('cache-uri uri)
('date date) ('ttl ttl) ('value #f))
(+ date %narinfo-negative-ttl))
(+ date ttl))
(('narinfo ('version 2) ('cache-uri uri)
('date date) ('ttl ttl) ('value value))
(+ date ttl))