通過設置.htaccess給WordPress站點Leverage browser caching
點擊數: 2313
- # Turn on Expires and set default to 0
- ExpiresActive On
- ExpiresDefault A0
- # Set up caching on media files for 1 year (forever?)
- "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
- ExpiresDefault A29030400
- Header append Cache-Control "public"
- # Set up caching on media files for 1 week
- "\.(gif|jpg|jpeg|png|swf)$">
- ExpiresDefault A604800
- Header append Cache-Control "public"
- # Set up 2 Hour caching on commonly updated files
- "\.(xml|txt|html|js|css)$">
- ExpiresDefault A7200
- Header append Cache-Control "proxy-revalidate"
- # Force no caching for dynamic files
- "\.(php|cgi|pl|htm)$">
- ExpiresActive Off
- Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
- Header set Pragma "no-cache"