ASP+頁緩存OutputCacheDuration用法(指定頁面過時時間)
例子:
<%@ OutputCache Duration="60" %>
就是這個頁在緩沖中保存60秒。
<%@ OutputCache Duration="60" %>
就是這個頁在緩沖中保存60秒。
下面是利用緩沖的程序頁例子
<%@ OutputCache Duration="10" %>
<html>
<script language="C#" runat="server">
void Page_Load(Object sender, EventArgs e) {
TimeMsg.Text = DateTime.Now.ToString();
}
</script>
<body>
<h3><font face="Verdana">Using the Output Cache</font></h3>
<p><i>Last generated on:</i> <asp:label id="TimeMsg" runat="server"/>
</body>
</html>