diff --git a/tools/citrineos-core-main/apps/operator-ui/next.config.mjs b/tools/citrineos-core-main/apps/operator-ui/next.config.mjs index 60fa803..9fe1b3e 100644 --- a/tools/citrineos-core-main/apps/operator-ui/next.config.mjs +++ b/tools/citrineos-core-main/apps/operator-ui/next.config.mjs @@ -40,7 +40,7 @@ const nextConfig = { }, ], }, - webpack: (config) => { + webpack: (config, { isServer }) => { config.resolve.alias = { ...config.resolve.alias, 'class-transformer/types/storage': resolve( @@ -48,6 +48,11 @@ const nextConfig = { 'node_modules/class-transformer/cjs/storage.js', ), }; + // Force new file names to bust cache + if (!isServer) { + config.output.filename = 'static/chunks/[name].[contenthash:8].js'; + config.output.chunkFilename = 'static/chunks/[name].[contenthash:8].js'; + } return config; }, async headers() { @@ -61,6 +66,15 @@ const nextConfig = { }, ], }, + { + source: '/_next/static/:path*', + headers: [ + { + key: 'Cache-Control', + value: 'no-cache, no-store, must-revalidate', + }, + ], + }, ]; }, };