새소식

Front

HTML, ASP, JSP, PHP, 웹 캐시 저장 방지

  • -
728x90

안녕하세요. 이사작전.com의 개발자 말랑고양입니다.

오늘은 웹 캐시 저장을 방지하는 방법을 공유하려 합니다.


다음은 각각의 케이스별 No-Cache 설정방법입니다.

HTML인 경우 

1
2
3
4
<META http-equiv="Pragma" content="no-cache"
<META http-equiv="Cache-Control" content="No-Cache"
<META http-equiv="Expires" content="-1"
 
cs


ASP인 경우   

1
2
3
4
5
<%   
Response.Expires = 0   
Response.AddHeader "Pragma","no-cache"   
Response.AddHeader "Cache-Control","no-cache,must-revalidate"   
%>   
cs


JSP인 경우   

1
2
3
4
5
6
7
<%   
response.setHeader("Cache-Control","no-store");   
response.setHeader("Pragma","no-cache");   
response.setDateHeader("Expires",0);   
if (request.getProtocol().equals("HTTP/1.1")) 
        response.setHeader("Cache-Control""no-cache"); 
%>   
cs


PHP인 경우   

1
2
3
4
<?   
header("Pragma: no-cache");   
header("Cache-Control: no-cache,must-revalidate");   
?>
cs


감사합니다.

#웹 캐시 #캐싱 #캐시방지 #저장 #방지


reference : https://support.microsoft.com/ko-kr/help/234067/how-to-prevent-caching-in-internet-explorer

reference : http://lab.gamecodi.com/board/zboard.php?id=GAMECODILAB_Lecture&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=hit&desc=asc&no=34

반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.