civodul pushed a commit to branch master
in repository maintenance.
commit 5372ed09781a98dcbcad2618749a8fba1224e7a2
Author: Ludovic Courtès <[email protected]>
AuthorDate: Fri Sep 30 11:58:25 2022 +0200
hydra: bayfront: Allow clients to cache hpc.guix.info/static.
* hydra/bayfront.scm (%hpc.guix.info-nginx-servers): Add location block
for "/static", with 'Cache-Control' headers.
---
hydra/bayfront.scm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index 707df54..b762f74 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -349,6 +349,12 @@ add_header X-Frame-Options SAMEORIGIN;\n")
(nginx-location-configuration
(uri "~ /static/images/sort_.*\\.png")
(body '("proxy_pass http://localhost:5000;")))
+
+ ;; Improve caching for CSS, images, etc.
+ (nginx-location-configuration
+ (uri "/static")
+ (body '("add_header Cache-Control max-age=21600;")))
+
(nginx-location-configuration ; Videos
(uri "/static/videos")
(body '("root /srv/guix-hpc-videos;"))))))