<FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>
Header set Cache-Control “max-age=604800, public”
</FilesMatch>
<FilesMatch “\.(xml|txt)$”>
Header set Cache-Control “max-age=18000, public, must-revalidate”
</FilesMatch>
<FilesMatch “\.(html|htm|php|shtml)$”>
Header set Cache-Control “max-age=3600, must-revalidate”
</FilesMatch>
</IfModule>
如果沒有開啟“mod_headers”模塊,而又沒有加“”條件判斷的話,網站就會出錯!
設置 max-age or expires是用來緩存靜態(tài)文件,提升網站的的加載速度!