Hello
What is the role of action filter in ASP.NET MVC
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Priya LingePosted Dec 15, 2011, 12:19 AM
1.An action filter is an attribute that we can apply to a controller action or an entire controller
that modifies the way in which the action is executed.
•OutputCache – This action filter caches the output of a controller action for a specified amount of time.
•HandleError – This action filter handles errors raised when a controller action executes.
•Authorize – This action filter enables you to restrict access to a particular user or role.
2.ASP.NET MVC Action Filter - Caching and Compression
Caching plays a major role in developing highly scalable web applications. We can cache any http get request in the user browser for a predefined time,
if the user request the same URL in that predefined time the response will be loaded from the browser cache instead of the server.
Another important thing is compression. Now a days, all modern browsers accept compressed contents and it saves huge bandwidth.
Please check below link.
http://www.asp.net/mvc/tutorials/older-versions/controllers-and-routing/understanding-action-filters-cs
http://weblogs.asp.net/rashid/archive/2008/03/28/asp-net-mvc-action-filter-caching-and-compression.aspx
Hope this will help you.
Thanks.