Using apaceh caching and browser cache


#1

I would like to turn on some caching on the server with the piwik installation. Something like below, but does anyone know if this is going to cause any issues?


# Turn on Expires and set default to 0
# these shuold be turned on when in production mode
ExpiresActive On
ExpiresDefault A0

# Set up caching on media files for 1 month
<FilesMatch "\.(js|css)$">
  ExpiresDefault A29030400
  Header append Cache-Control "public"
</FilesMatch>

# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
  ExpiresDefault A604800
  Header append Cache-Control "public"
</FilesMatch>

# Force no caching for dynamic files
<FilesMatch "\.(php)$">
  ExpiresActive Off
  Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
  Header set Pragma "no-cache"
</FilesMatch>


(Matthieu Aubry) #2

It looks good, should work fine!