guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: hydra: bayfront: Improve caching for packages.gui


From: Ludovic Courtès
Subject: branch master updated: hydra: bayfront: Improve caching for packages.guix.gnu.org.
Date: Thu, 14 Dec 2023 06:44:34 -0500

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch master
in repository maintenance.

The following commit(s) were added to refs/heads/master by this push:
     new 4f7edc0  hydra: bayfront: Improve caching for packages.guix.gnu.org.
4f7edc0 is described below

commit 4f7edc0c5e5eba7ea2dd283100e66c0520795da9
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Dec 14 12:43:11 2023 +0100

    hydra: bayfront: Improve caching for packages.guix.gnu.org.
    
    * hydra/bayfront.scm (%packages.guix.gnu.org-nginx-servers): Add
    location blocks for /packages and /themes.
---
 hydra/bayfront.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index 951a81a..14ea44a 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -897,7 +897,26 @@ proxy_set_header  Via  $via;"
        (uri "/")
        (body '("proxy_pass http://packages;";
                "proxy_http_version 1.1;"
-               "proxy_set_header Connection \"\";"))))))))
+               "proxy_set_header Connection \"\";")))
+
+      (nginx-location-configuration
+       (uri "/packages")
+       (body '("proxy_cache static;"
+               "proxy_cache_valid 200 2h;"   ;cache hits for a few hours
+               "proxy_cache_valid any 5m;"   ;cache misses/others for 5 min
+
+               "add_header Cache-Control max-age=3600;")))
+
+      ;; Improve caching for CSS, images, etc.
+      (nginx-location-configuration
+       (uri "/themes")
+       (body '(;; Cache these files since that's always the first thing we
+               ;; ask for.
+               "proxy_cache static;"
+               "proxy_cache_valid 200 12h;"  ;cache hits for a while
+               "proxy_cache_valid any 5m;"   ;cache misses/others for 5 min
+
+               "add_header Cache-Control max-age=21600;"))))))))
 
 (define %guix.gnu.org-http-nginx-servers
   ;; Redirect domains that don't explicitly support HTTP (below) to HTTPS.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]