我有一系列以这种方式缓存的缓存对象
HttpRuntime.Cache.Insert(....)
我正在尝试使用varyByCustom
用户控件的声明,并使用此缓存对象返回一个值global.asax
Public Overrides Function GetVaryByCustomString(context As HttpContext, arg As String) As String
If arg = "getCache" Then
Return HttpRuntime.Cache.Get("mainMenu_added")
End If
end function
不过,我每次都得到一个空记录。
我在其他地方检查过,缓存键确实存在,但在 global.asax 中似乎无法访问?