perf: optimize launcher boot and media loading

This commit is contained in:
DCCONSTRUCTIONS
2026-05-15 19:53:10 +03:00
parent 3799483638
commit 3094464f62
5 changed files with 143 additions and 161 deletions
+13 -1
View File
@@ -1543,7 +1543,19 @@ if (process.env.NODE_ENV === "production") {
throw new Error("Launcher production build is missing. Run npm run build before starting the server.");
}
app.use(express.static(distRoot, { index: false }));
app.use(express.static(distRoot, {
index: false,
immutable: true,
maxAge: "1y",
setHeaders(res, assetPath) {
if (assetPath === indexHtmlPath) {
res.setHeader("Cache-Control", noStoreCacheControl);
return;
}
res.setHeader("Cache-Control", "public, max-age=31536000, immutable");
},
}));
app.use((req, res, next) => {
if (req.method !== "GET" && req.method !== "HEAD") {
next();