RSSAll Entries Tagged With: "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 cache. The response would include a Cache-Control header value of private and an Expires header [...]

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 being used are kept in cache. Pages that are cached once and then never accessed [...]

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 semicolon-separated list of strings representing query string values in a GET request or variables in a POST request. This is [...]

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 after its first access.

<%@ Page Language="C#" %>
<%@ OutputCache Duration=’3600′ VaryByParam=’none’ %>
<html>
 
<script runat="server">
[...]