diff --git a/web/webpack.config.ts b/web/webpack.config.ts index b8217bc3..ca14c8e1 100644 --- a/web/webpack.config.ts +++ b/web/webpack.config.ts @@ -179,6 +179,12 @@ const config: Configuration = { expiration: { maxAgeSeconds: 1 * 60 * 60, // 1h }, + cacheableResponse: { + // 只缓存js, 防止404后台直接fallback到html + headers: { + 'content-type': 'application/javascript; charset=utf-8', + }, + }, }, }, ],