guix-commits
[Top][All Lists]
Advanced

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

01/03: nginx: berlin: Allow clients to cache /static and /manual stuff.


From: Ludovic Courtès
Subject: 01/03: nginx: berlin: Allow clients to cache /static and /manual stuff.
Date: Fri, 16 Oct 2020 08:39:03 -0400 (EDT)

civodul pushed a commit to branch master
in repository maintenance.

commit 24b6cb9959d2eb3ba7c6056b0ed77be29db278de
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Oct 8 15:07:24 2020 +0200

    nginx: berlin: Allow clients to cache /static and /manual stuff.
    
    * hydra/nginx/berlin.scm (guix.gnu.org-locations): Add "/static" location
    with "expires" directive.  Add "expires" directive for /manual/devel,
    /manual, and /cookbook.
---
 hydra/nginx/berlin.scm | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index f2b58b8..ca51082 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -700,16 +700,27 @@ PUBLISH-URL."
     (uri "/guix-videos")
     (body (list "alias /srv/videos;")))
 
+   ;; Let browsers cache files under /static for a while.
+   ;; XXX: This is really a hack to work around the fact that we can't have
+   ;; 'If-Modified-Since' because timestamps are zeroed.
+   (nginx-location-configuration
+    (uri "/static")
+    (body (list "expires 1d;"
+                "alias /srv/guix.gnu.org/static;")))
+
    ;; These rules take precedence over the '.pdf' and '.html' rules below.
    (nginx-location-configuration
     (uri "~ /manual/devel/(.*)$")
-    (body (list "alias /srv/guix-manual-devel/$1;")))
+    (body (list "expires 4h;"
+                "alias /srv/guix-manual-devel/$1;")))
    (nginx-location-configuration
     (uri "~ /manual/(.*)$")
-    (body (list "alias /srv/guix-manual/$1;")))
+    (body (list "expires 1d;"
+                "alias /srv/guix-manual/$1;")))
    (nginx-location-configuration
     (uri "~ /cookbook/(.*)$")
-    (body (list "alias /srv/guix-cookbook/$1;")))
+    (body (list "expires 4h;"
+                "alias /srv/guix-cookbook/$1;")))
    (nginx-location-configuration
     (uri "~ \\.pdf$")                             ;*.pdf at the top level
     (body (list "root /srv/guix-pdfs;")))



reply via email to

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