2010-01-22 2 views
2

내 웹 사이트의 특정 파일 캐싱에 만료 날짜를 설정하려고하는 사용자를 도와 줄 수 있는지 궁금합니다. 어떻게 할 수 있는지 알려주는 팁이 있습니까? 필자는 전체 파일 형식을 변경하는 방법에 대해 알아 보았지만 특정 파일은 변경할 수 없었습니다. 그게 가능하니?캐시의 파일 만료 제어

ExpiresActive On     # enable expirations 
ExpiresByType image/gif A2592000 # expire GIF images after a month 
           # in the client's cache 
ExpiresByType text/html M604800 # HTML documents are good for a 
           # week from the time they were 
           # changed, period 

답변

2

이 당신을 도울 수 있습니다 http://viralpatel.net/blogs/2009/06/21-very-useful-htaccess-tips-tricks.html

체크 아웃 팁 # 6 : "htaccess로와 캐싱 기법을 구현". 여기에서 특정 파일 기반 처리 방법을 생각해 낼 수 있다고 생각합니다.

 
<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$"> 
Header set Cache-Control "public" 
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" 
Header unset Last-Modified 
</FilesMatch>

<FilesMatch ".(html|htm|xml|txt|xsl)$"> Header set Cache-Control "max-age=7200, must-revalidate" </FilesMatch>

<FilesMatch ".(js|css)$"> Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" </FilesMatch>