http://httpd.apache.org/docs/2.0/mod/mod_expires.html


httpd.conf 에 간단히

ExpiresActive On
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"

요렇게 해 주면 js, css, images 는 브라우저 캐시를 이용하게 됩니다.

그러면 한번 불러온 저 파일들은 뒤로,앞으로 이동시에 다시 불러오지 않습니다.
오직 새로고침시에만 다시 불러옵니다.



파일 다운로드 php 에는

header('Pragma: cache'); // 아파치가 자동으로 no-cache 를 붙이기 때문에 넣었습니다.
header('Cache-Control: max-age=2592000');
header('Expires: '.substr(gmdate('r', strtotime('+1 MONTH')), 0, -5).'GMT');

요렇게 해주면 됩니다.
Posted by 알 수 없는 사용자
,