I wish to accelerate this site. I'm wondering I have tried it properly syntax smart.

<IfModule mod_expires.c>
  Header unset Pragma
  FileETag None
  Header unset ETag
  ExpiresActive On

ExpiresDefault "access plus 1 year" 

  <FilesMatch "\\.(ast|php)$">
   ExpiresDefault A7200
    Header set Cache-Control "public, max-age=3600, must-revalidate"

<FilesMatch "(?i)^.*\.(ico|png|gif|jpg)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2012 00:00:00 GMT"
Header set Cache-Control "public, no-transform"

  <FilesMatch "\\.(css|js|xml)$">
    Header set Cache-Control "public, max-age=604800, must-revalidate"


Don't cache asp or php or any dynamic page! This makes unpredictable result.

Here's a good example, if you have a webpage known as catalog.php that renders the merchandise catalog with uptodate cost and stock availability. Because you have place it to cache the end result on browser to have an hour, it'll show stale data on browser to have an hour!

Dynamic pages will not be cached wholesale such as this. You have to put individual caching logic on pages depending on how fresh the information ought to be came back in the page.

For static pages though that you can do such wholesale expiration. However, be cautious when you place css and js files to run out after twelve months, a person who visits your website today won't fetch latest js and css from webserver for a lot of days or several weeks. If one makes changes towards the scripts or style, they're not going to begin to see the changes unless of course you utilize some unique querystring to alter the link to the files by hand.

I've talked about a strategy here that actually works for ASP.Internet only. However it informs you concerning the dos and do nots.


You may also read my 7 strategies for making best utilization of caching that describes these kinds of approaches and benefits and drawbacks of every:


Tell me if the helps.