MVC3 OutputCache not working on Server and Client as expected

情到浓时终转凉″ 提交于 2019-12-04 06:11:40

You can use OutputCacheLocation.Any which specifies

The output cache can be located on the browser client (where the request originated), on a proxy server (or any other server) participating in the request, or on the server where the request was processed. This value corresponds to the HttpCacheability.Public enumeration value.

You may want to also set Cache-control public to in the HTTP header for these requests.

Edit

It seems, depending on your .Net version of the web server you may need to include Response.Cache.SetOmitVaryStar(true); within your controller action to remove the Vary * headers as you suggest.

Details of the reason why in .Net 4 breaking changes release notes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!