ASP.NET Tutorial/Cache/Priorities

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Specifying Cache Item Priorities

   <source lang="csharp">

The following web configuration file changes the memory limit of your application to 100,000 kilobytes and disables the expiration of items in the cache. File: Web.Config <configuration>

       <cache privateBytesLimit="100000" disableExpiration="true"/>


The following page displays your application"s current private bytes limit <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <script runat="server">

   void Page_Load()
       lblPrivateBytes.Text = Cache.EffectivePrivateBytesLimit.ToString("n0");

</script> <html xmlns="" > <head id="Head1" runat="server">

   <title>Show Private Bytes Limit</title>

</head> <body>

   <form id="form1" runat="server">
   Effective Private Bytes Limit:
       Runat="server" />

</body> </html></source>