Work with HttpCachePolicy : HttpCachePolicy « Network « ASP.Net






Work with HttpCachePolicy

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Cacheing Output in ASP.NET</title>
      <script runat="server">
         Sub Page_Load()
            Dim myCachePol As HttpCachePolicy
            myCachePol = Response.Cache
            myCachePol.SetExpires(DateTime.Now.AddSeconds(120))
            myCachePol.SetCacheability(HttpCacheability.Public)
            Message.Text = Now.ToString()
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>

 








Related examples in the same category