我的环境:
我将属性
[ResponseCache(NoStore = true)]
我们可以将其设置在
UseStaticFiles
app.UseStaticFiles(new StaticFileOptions { OnPrepareResponse = ctx => { const string cacheControlValue = "no-store"; ctx.Context.Response.Headers.Append("Cache-Control", cacheControlValue); } });