From d7b05b40e9ec58d595f5be89c5fbd38176aecc0e Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 15 May 2026 12:29:14 -0400 Subject: [PATCH] fix(host): drop UseStaticFiles so MapStaticAssets controls caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UseStaticFiles middleware ran before the MapStaticAssets endpoints and served static assets (monaco-init.js, site.css, etc.) with no Cache-Control header. Browsers then heuristically cached them and kept serving stale copies across deploys — e.g. the Monaco editor ran an old monaco-init.js that did not send the script kind, so inbound API method scripts were analysed against the wrong globals and 'Route' was flagged as undefined. MapStaticAssets alone now serves every static asset, tagging non-fingerprinted files with Cache-Control: no-cache so the browser always revalidates via ETag. --- src/ScadaLink.Host/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ScadaLink.Host/Program.cs b/src/ScadaLink.Host/Program.cs index 637fdba..e1595c9 100644 --- a/src/ScadaLink.Host/Program.cs +++ b/src/ScadaLink.Host/Program.cs @@ -117,7 +117,6 @@ try } // Middleware pipeline - app.UseStaticFiles(); app.UseWebSockets(); app.UseRouting(); app.UseAuthentication();