What are advantages of caching?

There are following advantages of caching: Reduce hosting server round-trips When content is cached at the client or in proxies, it cause minimum request to server. Reduce database server round-trips When content is cached at the web server, it can eliminate the database request. Reduce network traffic When content is cached at the client side, it also reduce the network traffic. Avoid time-consumption for regenerating reusable content When reusable content is cached, it avoid the time consumption for regenerating reusable content. Improve performance Since cached content reduce round-trips, network traffic and avoid time consumption for regenerating reusable content which cause … Click here to continue…..

What is caching and when to use it?

Caching is a most important aspect of high-performance web application. Caching provides a way of storing frequently accessed data and reusing that data. Practically, this is an effective way for improving web application’s performance. When to use caching Use caching for contents that are accessed frequently. Avoid caching for contents that are unique per user. Avoid caching for contents that are accessed infrequently/rarely. Use the VaryByCustom function to cache multiple versions of a page based on customization aspects of the request such as cookies, role, theme, browser, and so on. For efficient caching use 64-bit version of Windows Server and … Click here to continue…..

What are different types of Filters in ASP.NET MVC?

The ASP.NET MVC framework provides five types of filters. Authentication Filters – This filter is introduced with ASP.NET MVC5. The IAuthenticationFilter interface is used to create CustomAuthentication filter. The definition of this interface is given below-

You can create your CustomAuthentication filter attribute by implementing IAuthenticationFilter as shown below-

Authorization Filters – The ASP.NET MVC Authorize filter attribute implements the IAuthorizationFilter interface. The definition of this interface is given below-

The AuthorizeAttribute class provides the following methods to override in the CustomAuthorize attribute class.

In this way you can make your CustomAuthorize filter attribute either by … Click here to continue…..

What are ASP.NET MVC Filters and Attributes?

ASP.NET MVC provides a simple way to inject your piece of code or logic either before or after an action is executed. This is achieved by decorating the controllers or actions with ASP.NET MVC attributes or custom attributes. An attribute or custom attribute implements the ASP.NET MVC filters (filter interface) and can contain your piece of code or logic. You can make your own custom filters or attributes either by implementing ASP.NET MVC filter interface or by inheriting and overriding methods of ASP.NET MVC filter attribute class if available. Typically, Filters are used to perform the following common functionalities in your … Click here to continue…..

What is Child action and how to invoke it?

Child actions are useful for creating reusable widgets which could be embedded into your views. In ASP.NET MVC partial views are used to create reusable widgets and a partial can be render by an action method. This action method can has child attribute and has its independent MVC lifecycle from parent view. Also, an action which has child attribute cannot be called independently. It always will be called within a parent view otherwise it would give error.

A child action is invoked by using @Html.RenderAction or @Html.Action helper methods from inside of a view.