TechnoBabbler
heroku app(php)에서 정적 파일 캐싱하기
naggingmachine
2013. 7. 29. 10:25
heroku app에서 php 프로젝트를 생성해서 개발하게 되면, 기본적으로 static file에 대한 caching이 안된다.하지만 아래의 내용을 httpd.conf 파일에 추가하여 간단하게 문제 해결
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|avi|mov|mp4|mpeg|mpg|mp3|pdf|bmp|js|css|flv|swf|doc)$"> Header set Cache-Control "max-age=7200" </FilesMatch> <FilesMatch "\.(xml|txt)$"> Header set Cache-Control "max-age=172800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(html|htm)$"> Header set Cache-Control "max-age=7200, must-revalidate" </FilesMatch>
git add httpd.conf 한 다음, commit 하고 push하면 끝~!