Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable client side and proxy caching in ASP.NET MVC?

Tags:

asp.net-mvc

What is the proper (browser agnostic) way to disable page caching in ASP.NET MVC?

like image 629
kjgilla Avatar asked May 13 '09 22:05

kjgilla


People also ask

What are the different caching techniques available in .NET MVC?

ASP.NET supports three types of caching: Page Output Caching [Output caching] Page Fragment Caching [Output caching] Data Caching.

What is the correct way to apply caching in MVC?

In ASP.NET MVC, there is an OutputCache filter attribute that you can apply and this is the same concept as output caching in web forms. The output cache enables you to cache the content returned by a controller action. Output caching basically allows you to store the output of a particular controller in the memory.

What is caching in ASP.NET MVC?

Caching is used to improve the performance in ASP.NET MVC. Caching is a technique which stores something in memory that is being used frequently to provide better performance. In ASP.NET MVC, OutputCache attribute is used for applying Caching.


1 Answers

Try this:

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")] public ActionResult NonCacheableData() {     return View(); } 
like image 83
DSO Avatar answered Sep 22 '22 09:09

DSO