dev: don't cache index

Massimo Melina committed Apr 8, 2023 at 15:06 UTC 922807fdbef2098157a4a84c924b7ac9f118457e
1 file changed +2 -2
src/serveGuiFiles.ts
+2 -2
@@ -53,8 +53,6 @@ function serveStatic(uri: string): Koa.Middleware {
53 return serveFile(ctx, fullPath, 'auto', content)
54 // we don't cache the index as it's small and may prevent plugins change to apply
55 ctx.body = await treatIndex(ctx, uri, String(content))
56 - ctx.type = 'html'
57 - ctx.set('Cache-Control', 'no-store, no-cache, must-revalidate')
56 }
57 }
58
@@ -71,6 +69,8 @@ function adjustBundlerLinks(ctx: Koa.Context, uri: string, data: string | Buffer
69 async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
70 const session = await refresh_session({}, ctx)
71 ctx.set('etag', '')
72 + ctx.set('Cache-Control', 'no-store, no-cache, must-revalidate')
73 + ctx.type = 'html'
74
75 const isFrontend = filesUri === FRONTEND_URI
76