Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: ASP.NET
Expertise: Intermediate
Oct 2, 2006

Improve Caching Perfomance with the Shared Attribute of the Output Directive

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" %>

MS Sridhar
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap