Skip to content

Commit 44c90dd

Browse files
authored
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
1 parent f18964d commit 44c90dd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/studio-server/src/routes/preview.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ export function registerPreviewRoutes(api: Hono, adapter: PreviewApiAdapter): vo
576576
const cacheHeaders: Record<string, string> = isText
577577
? { "Cache-Control": "no-store" }
578578
: {
579-
"Cache-Control": "private, max-age=3600, must-revalidate",
579+
"Cache-Control": "private, no-cache",
580580
ETag: etag,
581581
};
582582

0 commit comments

Comments
 (0)