How To How to download files to use browser cut-off in htaccess By Tech and Dev

Review Browser Caching

One of the key factors to improving the loading speed is by caching static files like javascripts, css, fonts and images in the user's browser.

It has recently become important, especially when webmasters test their pages on Google insights and receive the following message:


Set an expiration date or a maximum age in the HTTP headers for static
resources give the reader instructions to load previously downloaded resources
from local disk rather than over the network.

To easily fix it, just change the htaccess in the root directory of your website by adding the following:


    

    Expires Active On
ExpiresByType text / css A31536000
ExpiresByType application / x-javascript A31536000
ExpiresByType application / javascript A31536000
ExpiresByType text / javascript A31536000
ExpiresByType text / x-js A31536000
ExpiresByType text / html A3600
ExpiresByType text / correct text A3600
ExpiresByType image / svg + xml A3600
ExpiresByType text / xsl A3600
ExpiresByType text / xml A3600
ExpiresByType image / bmp A31536000
ExpiresByType image / gif A31536000
ExpiresByType image / jpeg A31536000
ExpiresByType application / x-font-otf A31536000
ExpiresByType application / pdf A31536000
ExpiresByType image / png A31536000
ExpiresByType application / vnd.ms-powerpoint A31536000
ExpiresByType audio / x-realaudio A31536000
ExpiresByType image / svg + xml A31536000
ExpiresByType image / tiff A31536000
ExpiresByType application / x-font-ttf A31536000
ExpiresByType application / x-font-woff A31536000
ExpiresByType application / zip code A31536000


This will cache most of the important static files. Feel free to add something you want.
31536000 means that the cookie will be done for 365 days while 3600 takes one hour.

Any questions? Comment below!

(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “http://connect.facebook.net/en_US/all.js#xfbml=1&appId=463292747036958”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));


this post was thanks to TECH AND DEV.

Excellent website on technology, I recommend you visit their site and see some of their articles.

THANK YOU FOR VISITING US AND CAN SUBSCRIBE TO OUR NEWSLESTER TO GET THE LATEST NEWS



ORIGINAL SOURCE LINK TECH AND DEV

Leave a Reply