Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What is Leverage Browser Caching and how to use it.

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 270
    Comment on it

    Here is the brief explanation of Leverage Browser Caching and how to use it to improve website performance.

    When a web browser i.e. Chrome, Firefox, Internet Explorer, Safari etc displays webpage it has to load several things like css files, javascript files, images and other resources.

    What web browser caching does is that it remember the resources that the browser has already loaded. This means that when a user goes from one page to another page on the website it does not have to load all css files and other resources again because it already has "remembered" all resources. The outcome is that the web pages load much faster.

    you can achieve this by adding some code to a file called .htaccess on your web host/server.

        ## EXPIRES CACHING ##
        
        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"
        
        ## EXPIRES CACHING ##
    

    Save the .htaccess file and then refresh your webpage.

    You can change the cache time periods according to your requirement like "1 year" or "1 month".

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: