Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OutputCache controller attribute vary by user role? Is this possible in .net MVC?

Tags:

asp.net-mvc

Is it possible to output cache controller actions differently based on user role? or if they are authenticated or not?

like image 336
Slee Avatar asked Feb 18 '10 15:02

Slee


People also ask

What is the use of OutputCache attribute in MVC?

The output cache enables you to cache the content returned by a controller action. That way, the same content does not need to be generated each and every time the same controller action is invoked. Imagine, for example, that your ASP.NET MVC application displays a list of database records in a view named Index.

Which of the following properties of OutputCache attribute can be used to control customize the caching?

Cache Profile It is an alternative to configuring output cache properties by modifying properties of the [OutputCache] attribute. It offers a couple of important advantages which are as follows. Controls how controller actions cache content in one central location.

What is OutputCache in action filter?

Output Caching enables us to cache the content returned by any controller method so that the same content does not need to be generated each time the same controller method is invoked. Introduction. The main purpose of using Output Caching is to dramatically improve the performance of an ASP.NET MVC Application.

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

Any (Default)- Content is cached in three locations- the Web Server, any proxy Servers and the Web Browser. Client- Content is cached on the Web Browser. Server- Content is cached on the Web Server. ServerAndClient- Content is cached on the Web Server and the Web Browser.


1 Answers

Take a look at VaryByCustom.

http://msdn.microsoft.com/en-us/library/system.web.httpapplication.getvarybycustomstring.aspx

like image 159
Paul Hiles Avatar answered Oct 10 '22 23:10

Paul Hiles