How to Leverage Browser Caching

You might be reading this because Adsense told you to activate this feature on your site.  The very basic simple explanation is this when I go to a site to view porn my browser has to download everything from their server so it will pop up on my screen.  So to avoid doing that every time I go to my favorite porn site their web servers use whats call browser caching which reminds my browser that it already has loaded the sources it needs for me to view the site and it wont try to reload them again. That makes it faster for me to enjoy my flicks.   

I’m just kidding btw about the porn site but any who to set this up it’s done by adding some code to a file called .htaccess on your web host/server. This is not difficult ok but if you need extra help contact me or leave a comment and I will try my best to help you.  The .htaccess file controls Many important things on a server so make sure to make a backup before we begin.

I will briefly go through this steps if you guys need more help let me know.  Use your favorite FTP program to get access to your .htaccess file on your server. These files wont open just like that but if you download it and edit it with my favorite editor Notepad ++ then you can edit save and upload the file back to your server.

 

Add this to the top of your .htaccess file this are the settings I use for my site

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType text/html “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 1 month”
</IfModule>
## EXPIRES CACHING ##

Should be good to go !  Let me know if it works or not for you ! 

bigo's blog © 2017
%d bloggers like this: