This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-site.git


The following commit(s) were added to refs/heads/master by this push:
     new ec84b636 Make browsers revalidate stylesheets and scripts
ec84b636 is described below

commit ec84b636aaf17952a9f570c9ed1dae138e76f664
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Mon Nov 2 08:49:18 2026 +0000

    Make browsers revalidate stylesheets and scripts
    
    site.css keeps its name when it changes, and the server sends no caching
    headers, so a browser may keep the old file for days next to new pages.
---
 content/filtered-resources/.htaccess | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/content/filtered-resources/.htaccess 
b/content/filtered-resources/.htaccess
index daaadcef..dd370f55 100644
--- a/content/filtered-resources/.htaccess
+++ b/content/filtered-resources/.htaccess
@@ -1,6 +1,14 @@
 IndexOptions +SuppressIcon
 ErrorDocument 404 /errors/404.html
 
+# Stylesheets and scripts keep their names when the site changes, so make 
browsers check for a new version on every
+# use; the ETag answers that check with a 304 when nothing has changed.
+<IfModule mod_headers.c>
+  <FilesMatch "\.(css|js)$">
+    Header set Cache-Control "no-cache"
+  </FilesMatch>
+</IfModule>
+
 Redirect Permanent /release-notes.html /docs/history.html
 Redirect Permanent /download.html /download.cgi
 RedirectMatch permanent ^/(.*)/download.html$ /$1/download.cgi

Reply via email to