How to disable browser cache in ASP.NET core rc2?

前端 未结 3 1610
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 09:47

I tried this Middleware but the browser still saving files.

I want user will always get the last version of js and css files.

public void Configure(I         


        
3条回答
  •  鱼传尺愫
    2020-12-03 10:31

    Disabling browser cache in ASP.NET core:

    public class HomeController : Controller
    {
        [ResponseCache(NoStore =true, Location =ResponseCacheLocation.None)]
        public IActionResult Index()
        {
            return View();
        }
    }
    

提交回复
热议问题