mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 07:19:52 +00:00
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:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user