fix(studio-server): revalidate preview assets on every request (#3565)

Project preview assets (images, videos) were served with
Cache-Control: private, max-age=3600, must-revalidate. The 1-hour
max-age let browsers serve stale images from their disk cache without
revalidating, even after the file changed on disk. Hard refresh didn't
recover because it doesn't bypass iframe sub-resource caches.

Switch to `no-cache` so browsers always revalidate against the
existing mtime+size ETag. Unchanged assets still get efficient 304
responses.

Fixes #3564
This commit is contained in:
miga-heygen
2026-08-31 17:46:19 +00:00
committed by GitHub
parent f18964de0c
commit 44c90dd7ff
+1 -1
View File
@@ -576,7 +576,7 @@ export function registerPreviewRoutes(api: Hono, adapter: PreviewApiAdapter): vo
const cacheHeaders: Record<string, string> = isText
? { "Cache-Control": "no-store" }
: {
"Cache-Control": "private, max-age=3600, must-revalidate",
"Cache-Control": "private, no-cache",
ETag: etag,
};