Subscribe

RSS Feed (xml)

Partial Page Output Caching in ASP.NET

<%@ OutputCache Duration=”60” VaryByParam=”none” %>
<script runat=”server”>
Sub Page_Load(sender As Object, e As EventArgs)
timestamp.Text = DateTime.Now.ToString()
End Sub
</script>
<asp:Label id=”timestamp” runat=”server” />
Caching the entire contents of a page is not always desirable. Examples include:
n An application that executes per requested business logic
n An application that displays user-specific content (personalization)
Examples such as these are bad candidates for page output caching because the content
can be reused only by the same user. Good candidates for partial page output caching
include any dynamically generated content shared by all users, such as a menu or content
served from a database.

No comments:

Archives

Variety in the Web World