2012-08-02 2 views
0

저는 System.Web.Caching.OutputCacheProvider를 사용하고 있습니다. 브라우저 캐시를 원하지 않습니다. 서버 캐싱 만하고 싶습니다. 서버 캐시에서 뭔가 나오면 앞으로 24 시간의 Expires 헤더가 생성됩니다. 어떻게 수정합니까?ASP.NET OutputCacheProvider로 브라우저 캐싱 방지

Get() 메서드에서 HttpContext.Current.Response.Cache.SetExpires()를 호출해도 영향을 미치지 않으며 IIS에서 HTTP 응답 헤더 -> 공통 헤더 설정 -> 만료 웹 콘텐츠도 변경되지 않습니다.

답변

0

OutputCache 특성에 Location 특성을 사용할 수 있습니다. 고전 Response.Expires = 0 접근이 충분해야 그 후

[OutputCache(Location=OutputCacheLocation.Server)]

Asp.Net MVC

를 들어 Asp.Net 웹 페이지

<%@ OutputCache Location="Server" ...%>

(필요한 경우)의 경우 브라우저 캐싱을 방지합니다.