How to Leverage Browser Caching via .htaccess

By using this code, our main static files (images, CSS, PDF’s, JS, etc.) will be cached in order to produce faster loading times in the future.

Leverage Browser Caching

 # enable expirations  
 <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|txt|html|x-html|php|css|xml|js|woff|ttf|svg|eot)(\.gz)?$">  
 <IfModule mod_expires.c>  
     ExpiresActive On  
 <IfModule mod_headers.c>  
 # expire GIF images after a month in the client's cache  
 ExpiresByType image/gif A2592000  
 # HTML documents are good for a week from the  
 # time they were changed  
 ExpiresByType text/html M604800  

No comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + ''; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();