1
我無法弄清楚如何在下面發佈的不同URL格式下緩存此頁面。Asp.Net緩存特定的查詢字符串參數,而不是其他
我想緩存這些頁面:
/folder/
/folder/?page=2
/folder/?id=17
/folder/?id=17&page=2
我不希望有查詢字符串參數「搜索」將在所有緩存的頁面。
/folder/?search=1¶m1=1¶m2=2
我已經看過一些在的OutputCache的VaryByCustom是參數,但我不知道如何從被緩存停止底URL。
編輯 - 認字
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="cache.aspx.vb" Inherits="cache" %>
<%@ OutputCache Duration="3600" VaryByParam="page;id" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<%=date.now %>
</body>
</html>
的VaryByParam = 「頁面; ID」?可以正確處理所有的頁面,不過/文件夾/搜索= 1&參數1 = 1緩存和引用從輸出/文件夾/頁面請求。 – 2013-02-21 17:36:24
你必須更具體。 /文件夾/不是一個頁面,它是一個文件夾。 – 2013-02-21 18:10:31
www.domain.com/folder/的確請求頁面... – 2013-02-21 18:12:27