fix(host): drop UseStaticFiles so MapStaticAssets controls caching

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.
This commit is contained in:
Joseph Doherty
2026-05-15 12:29:14 -04:00
parent e54c4a6c2e
commit d7b05b40e9

View File

@@ -117,7 +117,6 @@ try
} }
// Middleware pipeline // Middleware pipeline
app.UseStaticFiles();
app.UseWebSockets(); app.UseWebSockets();
app.UseRouting(); app.UseRouting();
app.UseAuthentication(); app.UseAuthentication();