728x90
반응형

Cache-Control

<!-- 아무것도 캐싱하지 않기 -->
Cache-Control: no-store

<!-- no-cache이지만 캐시하지 말라는 뜻이 아님 
모든 캐시 사용 전 서버에 이 캐시를 사용해도 되는지를 묻는 용도 -->
Cache-Control: no-cache

<!-- 만료된 캐시만 서버에 확인 받음 -->
Cache-Control: must-revalidate

 

Age

<!-- 캐시 유효시간 부여, 초 단위이므로 아래 헤더는 1시간 유효시간 부여 -->
<!-- 즉, 1시간 후에 응답 캐시 만료 -->
Cache-Control: public, max-age=3600

 

Expires

<!-- 응답 컨텐츠 만료 시간 나타냄 -->
<!-- 단, max-age 있으면 무시됨 -->
Expires: Mon, 06 Jan 1990 07:28:00 GMT

 

HTML 헤더에 작성 시 예제

<!-- 로드할때마다 페이지를 캐싱하지 않음. (HTTP 1.0) -->
<meta http-equiv="pragma" content="no-cache" />

<!-- 로드할때마다 페이지를 캐싱하지 않음. (HTTP 1.1) -->
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />

<!-- 캐시 유효시간 0초 -->
<meta http-equiv="Cache-Control" content="max-age=0"/>

 <!-- 캐시를 바로 만료 -->
<meta http-equiv="expires" content="0" />

 <!-- 1980년 이후 페이지 캐시 만료 -->
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />

 


728x90
반응형