Caching is an important part of Web technology that is often used to improve the Web application performance.
In ASP.NET, each user control is cached separately by default. This creates a significant performance improvement. However, suppose you have an application in which the user control does not vary between pages and the control name is same across the pages.
In such cases, setting the Shared attribute” to true in the Output Directive allows you to have a single cached version of the user control in all the pages, instead of keeping a separate cache for each one of the same user control. You can potentially save a significant amount of memory by enabling the Shared attribute.
The following code shows how the cached user control output is accessed by multiple Web forms pages:
<%@ OutputCache Duration="60" VaryByParam="none" VaryByCustom="browser" Shared="true" %>
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.






















