antony-p of Code Library
8/18/2016 - 10:40 AM

Caching, Speed Issues etc

Caching, Speed Issues etc

#Testing

#Leverage Browser Caching

# One year for image files
<filesMatch ".(jpg|jpeg|png|gif|ico)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
# One month for css and js
<filesMatch ".(css|js)$">
Header set Cache-Control "max-age=2628000, public"
</filesMatch>

#Specify a Vary: Accept-Encoding header

<IfModule mod_headers.c>
  <FilesMatch ".(js|css|xml|gz|html)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
</IfModule>