kopug memo

名古屋で働くとあるWebエンジニアの覚書。

ApacheでMIME別にキャッシュの有効期限を設定する方法

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

M が使用された場合は、 すべてのキャッシュにある現在のドキュメントキャッシュは同時に期限が 切れます。これは同じ URL に毎週常に置かれる報せのようなものには 非常に有効です。

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