看板 Knuckles_note
作者 標題 [Linux][CentOS] Apache 設定expires檔案cache時間
時間 2012年07月03日 Tue. AM 12:01:34
參考 http://plog.longwin.com.tw/my_note-unix/2008/09/18/apache2-enable-mod_expires-2008
$ sudo vim /etc/httpd/conf.d/expires.conf
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/html A900
ExpiresByType text/xml A14400
ExpiresByType text/plain "access plus 1 hours"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/bmp "access plus 1 month"
ExpiresByType application/x-shockwave-flash A3600
</IfModule>
ExpiresActive On
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/html A900
ExpiresByType text/xml A14400
ExpiresByType text/plain "access plus 1 hours"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/bmp "access plus 1 month"
ExpiresByType application/x-shockwave-flash A3600
</IfModule>
要注意這個設定了之後,檔案有更新也不會抓新的了
必需更改檔名才能抓到新的
--
※ 作者: Knuckles 時間: 2012-07-03 00:01:34
※ 編輯: Knuckles 時間: 2017-11-21 17:52:29
※ 看板: KnucklesNote 文章推薦值: 0 目前人氣: 0 累積人氣: 1029
回列表(←)
分享