Fix Leverage Browser Caching Warning, to make your website faster

By August 10, 2017 Html, SEO, WordPress No Comments
Leverage browser caching

What is Leverage Browser Caching?

When a web browser load any web page it has to load several resourses like images, fonts, js file, CSS file, and other attached resources into your browser’s local cache. What browser caching does it “remember” the resources that the browser has already loaded. When a visitor goes to another page on website your logo, images, fonts, CSS files, etc. do not need to be loaded again, because the browser has saved them already. All this recourse will call from browser cache not from server. This is the reason that the first view of a web page takes longer than repeat visits.

Leverage browser caching, enables your web page files will get stored in the browser cache locally. Your pages will load much faster for repeat visitors and so will other pages that share those same resources.

If you have tested your web page for speed and found out that you need to leverage browser caching, here is how you do it.

The Leverage Browser Caching Warning?

The warning generate itself when your web server, or a third-party server, doesn’t have the correct HTTP cache headers implemented. Or the expires headers might exist, but the cache time is set too short. The most common reason is that your web server is not correctly configured. The second one is that the Google Analytical script gives us the warning. And the third is other third party scripts returning the warning.

leverage browser caching pagespeed insights assets

How to Fix the Leverage Browser Caching Warning.

When it comes to fixing the leverage browser caching warning there are a many different scenarios, that are usually used to solve this issue.

1. Adding Cache-Control Header in Nginx

You can add Cache-Control headers in Nginx by adding the following to your server config’s server location.

2. Adding Expires Headers in Nginx

You can add Expires headers in Nginx by adding the following to your server block. In this example, you can see how to specify different expire times based on file types.

3. Adding Cache-Control Headers in Apache

You can add Cache-Control headers in Apache by adding the following to your .htaccess file.

4. Adding Expires Headers .htaccess

You can add Expires headers in Apache by adding the following to your .htaccess file.

Here is the list of the most common file-types or mime-types for Expire Headers.

About Vijay Dhanvai

A passionate blogger by heart and mind, I have been working in this field for 7 years now. A WordPress Professional, web developer and designer who intends to guide his readers about Web Design, WordPress, Blogging, Web Development, and more.

Leave a Reply