我正在尋找一種僅爲匿名用戶配置緩存的方法。我期望這樣做的原因是當用戶登錄並創建內容時,他們不會立即看到內容。在我們的舊系統(linux/php/mysql)中,我們將它配置爲只緩存匿名用戶,這不是問題。僅爲匿名配置ASP.NET緩存?
現在,我們有在web.config緩存設置這樣
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="High" duration="60" varyByParam="*" enabled="true"/>
<add name="Medium" duration="30" varyByParam="*" enabled="true"/>
<add name="Low" duration="10" varyByParam="*" enabled="true"/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
我知道,我可以添加一個VaryByCustom是=「username」的像this post在談論。但是這並不能解決我的問題。它仍然緩存用戶登錄並存在相同的問題。