2010-04-08 4 views

답변

3

는 서버 측 캐싱에 대한 응답 객체를 구성하는 방법을 설명하는 링크입니다
Response.Buffer = True 
Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0)) 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
+0

ExpiresAbsolute의 경우, 내가 사용했습니다. Response.ExpiresAbsolute = DateTime.Now.AddDays (-1d); – user279521

0

질문에 클라이언트와 서버 모두에 캐시를 지정하지 마십시오. 나에게 이것은 아무 곳이나 캐싱을 의미하지 않는다.

이렇게하면 어디에서나 캐싱을 방지 할 수 있습니다.

Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); 
Response.Cache.SetCacheability(HttpCacheability.NoCache); 
Response.Cache.SetNoStore(); 

캐싱하지 않으려는 페이지의로드에 넣거나 기본 페이지 클래스를 만듭니다. 페이지 태그 앞에

<%@ Outputcache Location="None"%> 

: http://skysanders.net/subtext/archive/2010/03/23/preventing-caching-of-content-in-asp.net-pages-and-other-httphandlers.aspx

+0

당신은 정확합니다, 아무 곳에도 캐싱이 없습니다. – user279521

1
페이지가 캐시되고

, 그래서 솔루션에서

은 (는) 클라이언트 측에 캐시하지하는 것은이 태그를 넣어하는 것입니다

<%@ page > 

결과는 다음과 같습니다.

<%@ OutputCache Location="None" %> 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>