Fix styles.css cache-busting so CSS updates always reach the browser

This commit is contained in:
marvin
2026-09-13 13:43:58 -04:00
parent 34d7c2a77f
commit edb5d58bb4
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "site-gateway", "name": "site-gateway",
"version": "0.11.41", "version": "0.11.42",
"private": true, "private": true,
"description": "Site Gateway: simple self-hosted website publishing, reverse proxying, and automatic HTTPS.", "description": "Site Gateway: simple self-hosted website publishing, reverse proxying, and automatic HTTPS.",
"type": "module", "type": "module",
+1 -1
View File
@@ -7,7 +7,7 @@
<title>Site Gateway</title> <title>Site Gateway</title>
<meta name="description" content="Host sites, proxy services, and manage HTTPS from one simple dashboard."> <meta name="description" content="Host sites, proxy services, and manage HTTPS from one simple dashboard.">
<link rel="icon" type="image/png" href="/site-gateway-icon-approved.png"> <link rel="icon" type="image/png" href="/site-gateway-icon-approved.png">
<link rel="stylesheet" href="/styles.css"> <link rel="stylesheet" href="/styles.css?v=0.11.28">
</head> </head>
<body> <body>
<div id="login" class="login-shell hidden"> <div id="login" class="login-shell hidden">
+2 -1
View File
@@ -1014,7 +1014,8 @@ app.use(express.json());
app.use(express.urlencoded({ extended: false })); app.use(express.urlencoded({ extended: false }));
app.get(["/", "/index.html"], (req, res) => { app.get(["/", "/index.html"], (req, res) => {
const html = fs.readFileSync(path.join(publicDir, "index.html"), "utf8") const html = fs.readFileSync(path.join(publicDir, "index.html"), "utf8")
.replace(/\/(app|features)\.js\?v=[^"']+/g, `/$1.js?v=${appVersion}`); .replace(/\/(app|features)\.js\?v=[^"']+/g, `/$1.js?v=${appVersion}`)
.replace(/\/styles\.css\?v=[^"']+/g, `/styles.css?v=${appVersion}`);
res.type("html").send(html); res.type("html").send(html);
}); });
app.use(express.static(publicDir)); app.use(express.static(publicDir));