1. Home»
  2. Blog»
  3. SEO»
  4. On Page SEO»
  5. Web Performance»
  6. Leverage Browser Caching

Are you searching for a descriptive tutorial to learn how to leverage browser caching? I think you are trying to optimize your web page loading time and Google page speed insight score. Leverage browser caching absolutely help you to improve your web page speed and Google inside score. Read entire tutorial carefully to know all about caching. Here we will explain what is leverage browser caching and how to enable it. If you are using WordPress, PHP or apache server then you have to update HTTP headers in your htaccess file or if you are using ASP .net or IIS server you have to set HTTP headers in your web.config file to enable leverage browser caching.

Enable Leverage Browser Caching in PHP, Wordpress, Apache and IIS Server

What is Leverage Browser Caching?

Leverage browser caching is a process to save web page resources on visitor’s computer when he visits a web page. Whenever a browser loads a website, it has to request many HTTP requests to completely display a page. These HTTP request consists some images, mark-ups, style sheets and scripts. If you enable leverage browser caching, it will help you to improve your page loading score by using common files from cache.

Why is Leverage Browser Caching Important?

Leverage browser caching is very important to reduce your web page loading time by saving common files to visitor’s web page and use them again from cache. It will improve web page speed by saving commonly used images, HTML, CSS and JavaScript files to user’s web browser.

How to Leverage Browser Caching?

To enable leverage browser caching we need to update the requested headers of our files to use caching. We have to update our HTTP headers to set expiry times for all types of files on our web server. If you are using Apache server, you have to update HTTP headers in your htaccess file or if you are using IIS server, you have to update HTTP headers in your web.config file to leverage browser caching in ISS.

Enable Leverage Browser Caching in PHP and Apache Server via Htaccess

Follow these simple steps to leverage browser caching in PHP and Apache server via htaccess file:

  1. Login Cpanel: Login your hosting panel or control panel.
  2. Find Htaccess File: Find htaccess file in your root directory.
  3. Open Htaccess File: Open htaccess file in your web browser.
  4. Add IfModule Code: Add IfModule Code in your htaccess file given below.
  5. Save Htaccess File: Finaly save htaccess file.

## 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 application/pdf "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

Enable Leverage Browser Caching in WordPress?

You can enable leverage browser caching in WordPress via htaccess file as we explain above. You can also use W3 total cache framework to optimize your web page performance and user interface.

Enable Leverage Browser Caching in ASP .Net and IIS server via Web.config

Follow these simple steps to enable leverage browser caching in ASP .net and IIS server via web.config file:

  1. Login Cpanel: Login your hosting panel or control panel.
  2. Find Web.config File: Find web.config file in your root directory.
  3. Open Web.config File: Open web.config file in your web browser.
  4. Add cacheControlMode: Add cacheControlMode in your web.config file given below.
  5. Save Web.config File: Finaly save web.config file and check for caching.

<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseExpires" httpExpires="Tue,19 Jan 2038 03:14:07 GMT"/>
</staticContent>
</system.webServer>
</configuration>

Conclusion

Leverage browser caching really help to optimize web page loading time and Google insight score. Once you have enabled leverage browser caching, Visit Google web speed insights or GT metrix to check your web page for browser caching. Web page speed optimization is a part of on page SEO.



Copyright @2015 Web Developer Bareilly