[odrs-web] httpd: Apply public caching to ratings.json too



commit 7f98744922cc1f6a7f76be91c3267ae77a5ac1fa
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Aug 11 16:06:17 2020 +0100

    httpd: Apply public caching to ratings.json too
    
    The `<Location>` element wasn’t matching `/static/ratings.json` as
    Apache evaluates `<Location>s` before `Alias`es (and, in turn, before
    `<Directory>`s).
    
    Changing it to a `<Directory>` should fix that by referencing the
    on-disk `static` directory.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 app_data/httpd-cfg/odrs.gnome.org.conf | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/app_data/httpd-cfg/odrs.gnome.org.conf b/app_data/httpd-cfg/odrs.gnome.org.conf
index bfbd304..51c05f4 100644
--- a/app_data/httpd-cfg/odrs.gnome.org.conf
+++ b/app_data/httpd-cfg/odrs.gnome.org.conf
@@ -18,14 +18,15 @@
     SetEnv ODRS_REVIEWS_SECRET %{ENV:ODRS_REVIEWS_SECRET}
     SetEnv SQLALCHEMY_DATABASE_URI %{ENV:SQLALCHEMY_DATABASE_URI}
 
-    <Location /static/>
+    <Directory /opt/app-root/src/odrs/static>
         ExpiresActive On
         ExpiresByType image/png "access plus 1 week"
         ExpiresByType application/javascript "access plus 1 week"
         ExpiresByType text/javascript "access plus 1 week"
         ExpiresByType text/css "access plus 1 day"
+        ExpiresByType application/json "access plus 2 weeks"
         Header set Cache-Control "public"
-    </Location>
+    </Directory>
 </VirtualHost>
 
 <Directory "/opt/app-root/src/odrs/static">


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