civodul pushed a commit to branch master
in repository maintenance.

commit 3b4290fe2becacdac95d36ced49ab96e732f51c8
Author: Ludovic Courtès <[email protected]>
AuthorDate: Mon Sep 12 23:09:18 2022 +0200

    hydra: bayfront: Allow clients to cache 10years.guix.gnu.org/static.
    
    * hydra/bayfront.scm (%ten-years-of-guix-nginx-servers): Add location
    blocks for "/static", with 'Cache-Control' headers.
---
 hydra/bayfront.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index 27a9ed7..ab8d601 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -444,7 +444,10 @@ add_header X-Frame-Options SAMEORIGIN;"))
          (locations
           (list (nginx-location-configuration     ;for use by Certbot
                  (uri "/.well-known")
-                 (body '("root /var/www;"))))))
+                 (body '("root /var/www;")))
+                (nginx-location-configuration     ;improve caching
+                 (uri "/static")
+                 (body '("add_header Cache-Control max-age=21600;"))))))
 
         (nginx-server-configuration
          (server-name '("10years.guix.gnu.org"))
@@ -452,6 +455,10 @@ add_header X-Frame-Options SAMEORIGIN;"))
          (ssl-certificate 
"/etc/letsencrypt/live/10years.guix.gnu.org/fullchain.pem")
          (ssl-certificate-key 
"/etc/letsencrypt/live/10years.guix.gnu.org/privkey.pem")
          (root "/srv/ten-years-of-guix")
+         (locations
+          (list (nginx-location-configuration     ;improve caching
+                 (uri "/static")
+                 (body '("add_header Cache-Control max-age=21600;")))))
          (raw-content
           (list (cons %common-tls-options
                       %disable-last-modified-header)

Reply via email to