mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-23 01:25:57 +02:00
publish: Advertise a short TTL for "baking" 404s.
* guix/scripts/publish.scm (not-found): Add #:phrase and #:ttl
parameters and honor them.
* tests/publish.scm ("with cache"): Check the 'cache-control' header on
of the 404 response.
This commit is contained in:
@@ -355,6 +355,13 @@ FileSize: ~a~%"
|
||||
(basename %item) ".nar"))
|
||||
(response (http-get url)))
|
||||
(and (= 404 (response-code response))
|
||||
|
||||
;; We should get an explicitly short TTL for 404 in this case
|
||||
;; because it's going to become 200 shortly.
|
||||
(match (assq-ref (response-headers response) 'cache-control)
|
||||
((('max-age . ttl))
|
||||
(< ttl 3600)))
|
||||
|
||||
(wait-for-file cached)
|
||||
(let* ((body (http-get-port url))
|
||||
(compressed (http-get nar-url))
|
||||
|
||||
Reference in New Issue
Block a user