更新时间:2023-02-15 18:21:16
实际上 OutputCache指令用于客户端作为服务器端缓存。当您将该指令的位置
设置为 Any
时, Client
,下游
或 ServerAndClient
,设置适当的缓存响应标头,以使浏览器或代理不会请求同一页面再次提供网页的缓存版本。但是请记住,这些客户端可以***地再次请求这些页面。
Actually the OutputCache directive is used for both Client as Server side caching. When you set the Location
of that directive to Any
, Client
, Downstream
or ServerAndClient
, proper cache response headers are set such that browsers or proxies won't request the same page again and serve the cached version of your page. But keep in mind that those clients are free to request those pages again.
在设置指令后,具有Cache-Control标头的位置选项:<%@ OutputCache Location = XXX Duration = 60 VaryByParam = none%>
Location options with their Cache-Control headers after setting directive:
<%@ OutputCache Location="XXX" Duration="60" VaryByParam="none" %>