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:
@@ -117,7 +117,6 @@ try
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Middleware pipeline
|
// Middleware pipeline
|
||||||
app.UseStaticFiles();
|
|
||||||
app.UseWebSockets();
|
app.UseWebSockets();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
|
|||||||
Reference in New Issue
Block a user