Cache: Add cache-control headers with revalidation to ensure checksum consistency #9

Merged
Bart van der Braak merged 2 commits from cache-revalidation into main 2024-07-25 16:01:33 +02:00
3 changed files with 9 additions and 2 deletions
Showing only changes of commit 3d9bcdfc96 - Show all commits

View File

@ -1,5 +1,5 @@
FROM php:8.1-apache
RUN a2enmod proxy && a2enmod rewrite
RUN a2enmod proxy && a2enmod rewrite && a2enmod headers
EXPOSE 80

View File

@ -9,7 +9,7 @@ System requirements:
* PHP 7+
To run the site:
* `a2enmod proxy` and `a2enmod rewrite` to enable proxy pass and rewrite rules
* `a2enmod proxy`, `a2enmod rewrite` and `a2enmod headers` to enable proxy pass, rewrite rules and setting headers
* Add the `000-default.conf` to the `sites-available`
### Setup with Docker

View File

@ -26,6 +26,13 @@
SetHandler application/x-httpd-php
</FilesMatch>
<IfModule mod_headers.c>
# Make sure that CDN77 revalidates every 60 sec to prevent cache drift between builds and their shasum counterpart
<FilesMatch "\.(xz|msi|msix|exe|gz|bz2|dmg|sha256)$">
Header set Cache-Control "public, max-age=60, must-revalidate"
</FilesMatch>
</IfModule>
ProxyPass /admin/ws ws://localhost:8010/ws
ProxyPassReverse /admin/ws ws://localhost:8010/ws
ProxyPass /admin/ http://localhost:8010/