From 44c90dd7ff79d0564d676a295d6198e3974774d1 Mon Sep 17 00:00:00 2001 From: miga-heygen Date: Mon, 31 Aug 2026 17:46:19 +0000 Subject: [PATCH] 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 --- packages/studio-server/src/routes/preview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/studio-server/src/routes/preview.ts b/packages/studio-server/src/routes/preview.ts index 864af351b..f23b8c113 100644 --- a/packages/studio-server/src/routes/preview.ts +++ b/packages/studio-server/src/routes/preview.ts @@ -576,7 +576,7 @@ export function registerPreviewRoutes(api: Hono, adapter: PreviewApiAdapter): vo const cacheHeaders: Record = isText ? { "Cache-Control": "no-store" } : { - "Cache-Control": "private, max-age=3600, must-revalidate", + "Cache-Control": "private, no-cache", ETag: etag, };