0
是否有可能聲明性地設置clientCache
在IIS7中使用web.config的操作?IIS7和客戶端緩存與ASP.Net MVC
我們需要爲我們的Home/Index
操作設置1天的到期值。截至目前,我們正在使用filter屬性來完成此操作。是否有可能以同樣的方式完成聲明?
我們可以通過web.config中的location
和system.webServer
部分對靜態內容執行此操作,但不能執行操作方法。
<location path="Content">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<system.webServer>
<staticContent>
<clientCache httpExpires="Sat, 28 Nov 2009 09:00:00 GMT" cacheControlMode="UseExpires" />
</staticContent>
</system.webServer>
</location>