Tag Archives: output

Csharp client side private caching

We can enable private caching if we specified a value of ‘Client’ for the Location attribute of an OutputCache directive on a page. This page would not be saved in the server cache but will be saved in the client’s … Continue reading

Posted in Language Basics | Tagged , , | Leave a comment

Csharp Programmatically Setting Page Caching

The example code below shows a page whose expiration is set programmatically and uses the sliding expiration scheme. The sliding expiration scheme means that whenever a page is hit, the timeout is reset. This ensures that only items that are … Continue reading

Posted in Language Basics | Tagged , | Leave a comment

VaryByParam,VaryByHeader, VaryByControl, VaryByCustom OutputCache Directive Attributes

VaryByCustom Vary the output cache either by browser name and version or by a custom string, which must be handled in an overridden version of GetVaryByCustomString(). VaryByHeader A semicolon-separated list of strings representing headers submitted by a client. VaryByParam A … Continue reading

Posted in Language Basics | Tagged , , | Leave a comment

CSharp OutputCache Directive Example

The OutputCache directive is added to the header of any ASP.NET page. It specifies the duration (in seconds) that the page should be cached. The OutputCache directive example below specifies that this particular page should be cached for one hour … Continue reading

Posted in Language Basics | Tagged , , | 1 Comment