【发布时间】:2014-11-06 21:25:01
【问题描述】:
我有一个 CMS 应用程序代码,它在所有请求上调用 Response.Cache.SetNoStore(),如果我是正确的,这将阻止代理/cdn 缓存这些页面/内容。因此,我有条件地调用以下代码:
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetMaxAge(new TimeSpan(0, 30, 0));
Response.Cache.SetValidUntilExpires(true);
但这并没有从响应头中取出no-store参数,这是返回的http头:
Cache-Control:public, no-store, must-revalidate, max-age=1800
因此我的问题是,我怎样才能务实地取出 nostore 参数?如果这是不可能的,我如何/在哪里可以解析/修改 http-header,因为我试图解析 PagePreRender 事件并且没有应用 nostore 参数......这导致想知道这是哪个生命周期附加到标题?
【问题讨论】:
标签: c# asp.net caching iis cache-control