fix(server): limit immutable media cache headers

This commit is contained in:
Amruth Pillai
2026-07-28 08:31:26 +02:00
parent a2901bfb2e
commit dd0531091b
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ function createRootSeoMarkup(canonicalUrl: string) {
export const serveWebDistStatic = serveStatic({
root: staticRoot,
onFound: (_path, context) => {
if (context.req.path.startsWith("/videos/")) {
if (/^\/videos\/.*-v\d+\.(?:mp4|webp)$/.test(context.req.path)) {
context.header("Cache-Control", "public, max-age=31536000, immutable");
}
},