Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##################################################################
- ################## CACHING with "Cache-control" #############
- ### Description: This block is not needed, if you use "EXPIRES" method for caching.
- # But if your hosting doesnt support "EXPIRES", OR you just want
- # to use some specific options (i.e. revalidate,no-cache...), then
- # instead of "EXPIRES" method, use this block:
- ##################################################################
- <ifModule mod_headers.c>
- #max age is calculated in seconds (1 month = 2592000 )
- <filesMatch "\.(css|jpg|jpeg|png|gif|js|ico|pdf|flv|swf)$">
- Header set Cache-Control "max-age=2592000, public"
- </filesMatch>
- <filesMatch "\.(xml|txt)$">
- Header set Cache-Control "max-age=216000, public, must-revalidate"
- </filesMatch>
- <filesMatch "sitemap\.xml$">
- Header set Cache-Control "max-age=500, private, no-cache"
- </filesMatch>
- <filesMatch "\.(x?html?|htm)$">
- Header set Cache-Control "max-age=216000, private, must-revalidate"
- </filesMatch>
- <filesMatch "\.(php)$">
- Header set Cache-Control "max-age=0, private, must-revalidate"
- </filesMatch>
- </ifModule>
Advertisement
Add Comment
Please, Sign In to add comment