guix-commits
[Top][All Lists]
Advanced

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

01/06: Reduce max-age for the latest-processed-commit page


From: Christopher Baines
Subject: 01/06: Reduce max-age for the latest-processed-commit page
Date: Fri, 21 Jun 2024 07:30:46 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit a9dbeb5e0973d7da35c53b5752d3c4b677f8d564
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Wed Jun 12 16:54:35 2024 +0100

    Reduce max-age for the latest-processed-commit page
    
    As this shouldn't be cached for a day.
---
 guix-data-service/web/repository/controller.scm |  3 ++-
 guix-data-service/web/revision/controller.scm   | 13 ++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/guix-data-service/web/repository/controller.scm 
b/guix-data-service/web/repository/controller.scm
index b77ca1f..0d9434c 100644
--- a/guix-data-service/web/repository/controller.scm
+++ b/guix-data-service/web/repository/controller.scm
@@ -267,7 +267,8 @@
                                  #:path-base path
                                  #:header-text
                                  `("Latest processed revision for branch "
-                                   (samp ,branch-name)))
+                                   (samp ,branch-name))
+                                 #:max-age 60)
            (render-no-latest-revision mime-types
                                       repository-id
                                       branch-name))))
diff --git a/guix-data-service/web/revision/controller.scm 
b/guix-data-service/web/revision/controller.scm
index 114e9f4..aa7f226 100644
--- a/guix-data-service/web/revision/controller.scm
+++ b/guix-data-service/web/revision/controller.scm
@@ -446,7 +446,8 @@
                                commit-hash
                                #:key path-base
                                (header-text
-                                `("Revision " (samp ,commit-hash))))
+                                `("Revision " (samp ,commit-hash)))
+                               (max-age cache-control-default-max-age))
   (letpar& ((packages-count
              (with-resource-from-pool (connection-pool) conn
                (count-packages-in-revision conn commit-hash)))
@@ -484,7 +485,10 @@
                                                      (network_dependent . 
,(string=? network-dependent "t"))
                                                      (count             . 
,(string->number count))))))
                                        lint-warning-counts)))
-        #:extra-headers http-headers-for-unchanging-content))
+        #:extra-headers
+        `((cache-control
+           . (public
+              (max-age . ,max-age))))))
       (else
        (render-html
         #:sxml (view-revision
@@ -496,7 +500,10 @@
                 lint-warning-counts
                 #:path-base path-base
                 #:header-text header-text)
-        #:extra-headers http-headers-for-unchanging-content)))))
+        #:extra-headers
+        `((cache-control
+           . (public
+              (max-age . ,max-age)))))))))
 
 (define* (render-revision-system-tests mime-types
                                        commit-hash



reply via email to

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