1

I have to set http headers in my ASP.NET Core MVC application such that the browser does not cache content. I take a look to How to clear browser cache in MVC application? but it doesn't work on .NET Core platform.

I would like to do in .NET Core what was done in standard ASP.NET MVC in the post I linked to above.

mjwills
  • 23,389
  • 6
  • 40
  • 63
Simone Spagna
  • 626
  • 7
  • 27
  • @Cuppyzh I would like to do in .NET CORE what was done in standard MVC in the post I indicated. – Simone Spagna Aug 21 '19 at 12:12
  • 1
    If you do not want any caching then you can decorate your method or controller class with: `[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]` – Rahul Sharma Aug 21 '19 at 12:27

1 Answers1

2

If you want to prevent browser caching (including Internet Explorer 11), you can decorate your method or controller class with:

[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)] 

You can read more about Response Caching in .NET CORE here.

Rahul Sharma
  • 7,768
  • 2
  • 28
  • 54