Are you looking for an effective solution to Leverage Browser Caching in WordPress? If I am reading you right, you must be exploring the ways to increase your website loading speed. And tools like Google PageSpeed Insights or GTmatrix or Pingdom probably suggested you to Leverage Browser Caching via htaccess as a result. Or you might be looking for a Leverage Browser Caching WordPress Plugin?
Well, in this article, I am going to cover all the queries to Fix Leverage Browser Caching Warning. Further, I will also share some simple but very effective techniques to implement browser caching on your WordPress site.
And by any chance, if you have hosted your website on a shared hosting plan offered by Bluehost or SiteGround or any other similar hosting provider, you must apply the following methods to improve your site performance.
Did you read somewhere that Leverage Browser Caching via Htaccess can help you to increase your site speed?
Yes/No? Not Sure?
It’s all right, let me tell you one secret.
As per my experience,
Leveraging Browser Cache can help you to Increase your Website Loading Speed by up to 50%.
Now, you must be thinking about how it could be possible?
Stay with me, and I will explain it all in the following sections. But before we learn how to leverage browser caching, first we must understand what is the Browser Caching?
☲ Table of Contents
- What is Leverage Browser Caching?
- How to Leverage Browser Caching in WordPress
- How Leveraging Browser Cache can Speed-up Your Site
- Did I Leverage Browser Caching on my Website?
- How to Fix Leverage Browser Caching Warning
- Leverage Browser Caching via htaccess (without plugin)
- Leverage Browser Caching in NGINX
- Leverage Browser Caching WordPress Plugin
- Leverage Browser Caching for Google Analytics
- How to Cache Third-Party Resources
- How to Specify a Cache Validator
- Wrapping It Up
What is Leverage Browser Caching?
Browser caching is a technique, which allows a browser to locally store the cacheable resources (i.e. Images, JavaScript and CSS) of a website for a certain period of time. So, the browser only needs to download the updated resources while navigating the same website again. Thus, it improves site loading speed.
The method to take advantage of Browser Caching technique to improve your site loading speed called Leverage Browser Caching.
Leverage Browser Caching for the Following Cacheable Resources
While performing a test on think with Google, you can often notice a recommendation to leverage cache in the browser for the following cacheable resources in WordPress.
In most of the cases, the cacheable resources are the website files (such as images, JavaScripts, and CSS) which can be stored by the browser temporarily.
Google PageSpeed insights (API version 5) also recommends to Serve static assets with an efficient cache policy.
Learn, How to Speed up any website by 50% by only optimizing the htaccess file. Increase Site Loading Speed using htaccess.
How to Leverage Browser Caching in WordPress
3 Simple Steps Leverage Browser Caching in WordPress
- Install and Activate the Leverage Browser Caching – WordPress plugin
- Plugin will Specify the Expire Headers, Cache-Control Headers and Turn Off the ETags using your htaccess file.
- Test your site with PageSpeed tools again to see the changes.
Head over to the following section to for more details to Leverage Browser Caching via htaccess in WordPress with or without using a plugin.
How Leveraging Browser Cache can Speed-up Your Site
Before I go into the details, let’s first understand how Browser Caching Works? And how it helps to load your web pages faster.
A web browser needs to retrieve many resources from the server (i.e. HTML files, CSS file, JS files, text, images, etc.) in order to load a website.
Web Cache is the technology used in web browsers and software applications to ‘temporarily store’ or ‘remember’ visited web page resources on local disc. This temporarily stored data is called ‘ Web Cache’ or ‘HTTP Cache‘.
And when you visit the same website again. This time the browser downloads only updated content from the website and combine it with ‘temporarily stored’ data of that same website.
Due to this, web cache help to reduce bandwidth usages, server loads, etc. Therefore, Leverage Browser Caching became important to load your web pages faster.
In other words, it commands your web browser to
- Cache the website files locally for a set time period and,
- Loads the file from the local storage for next visits till the said period.
- As a result, loading website files from local storage help web browser to render and display website quicker.
Did you know that the Leverage Browser Caching is the most recommended action by PageSpeed Insights from the last five years?
Did I Leverage Browser Caching on my Website?
Absolutely Yes!
Okay, first of all, let me share my experience with you and then you can decide.
I have implemented Browser Caching on my website in 2014 and getting amazing results in terms of loading speed since then. And as a result, PageSpeed score of my website is nearly 100.
(Disclaimer – I got this PageSpeed score not only because of the implementation of Leverage Browser Caching on my website, but I have applied some other optimization techniques as well to achieve this score.)
You can also implement browser caching on your website easily by adding a simple piece of code in the htaccess file. Due to which, Leverage Browser Caching via Htaccess in WordPress is one of the best and easiest way I could recommend.
However, if you do not want to play with htaccess file of your website, It’s okay. There are several free WordPress Plugins to Fix Leverage Browser Caching Warning you can find in the WP repository.
But which plugin you should use? Jump on the plugin section to know more about my recommended Leverage Browser Caching WordPress plugins.
Furthermore, in the following sections of this article, I’ll discuss how you can Enable Leverage Browser Caching in WordPress with or without plugins? And why you should not avoid this?
Do you know that you can Increase Page Loading Speed by Minifying and Combining the Static Resources of your website? Here is a tutorial you must read to Minify JavaScript and CSS in WordPress.
How to Fix Leverage Browser Caching Warning
In order to Fix the Leverage Browser Caching Warning, your web server should allow web browsers to store visited webpage resources temporarily on the local disk.
Further, when the user will visit your site again, consequently, it will load faster because of the locally available resources.
As a result, you will notice a significant improvement in your website loading speed. We all learn this earlier, Right?
Your next question must be how to enable this? How your webserver will allow a browser to leverage web cache.
Serve Static Assets with an Efficient Cache Policy
The static assets like CSS, JavaScript files and images should be delivered with an adequate cache policy [1]. As HTTP caching can help you to speed up your page load time for returning users. You should increase your cache lifetime to speed up repeat visits to your page.
To Serve Static Assets with an Efficient Cache Policy, you need to Set Content Expiry Dates by adding Cache-Control Headers and ETag Headers in HTTP headers.
- Cache-Control states about the caching period of a particular file by the web browser.
- While ETag is used to verify changes between the cached resources and requested resources.
We can set a specific period in months or years to keep cache resources (i.e. HTML, CSS or JS files, images, etc.) locally.
Moreover, it is advisable to Set Expiry Dates as per the frequency of changes in resources, or in other words, how often you update static resources of your website.
Enable Leverage Browser Caching in WordPress
You can Enable Leverage Browser Caching in WordPress [2] by
- Adding Expire Headers
- Adding Cache-Control Headers and
- Turning ETags Off.
Let’s discuss in detail how to add Expire headers & Cache-Control headers, and how to Turn ETags Off in HTTP headers.
Leverage Browser Caching via htaccess (without plugin)
Let’s learn how to Leverage Browser Caching via htaccess on Apache Server without WordPress plugin. If your website is hosted on Apache Server, you can edit your htaccess file, read more here about How to Edit htaccess file in WordPress.
Step by step instructions to Leverage Browser Caching in WordPress via .htaccess:
- Go to WordPress Dashboard/cPanel of your website.
- Open .htaccess file (or config file).
- Paste the code given below in .htaccess file of the WordPress site.
- Save changes and you’re done.
- Test your site with PageSpeed tools again to see the changes.
1. Add Expire Headers (Apache)
# TN - START EXPIRES CACHE ExpiresActive On ExpiresByType text/css "access 1 month" ExpiresByType text/html "access 1 month" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/svg "access 1 year" ExpiresByType image/x-icon "access 1 year" ExpiresByType application/pdf "access 1 month" ExpiresByType application/xhtml-xml "access 1 month" ExpiresByType application/javascript "access 1 month" ExpiresByType text/x-javascript "access 1 month" ExpiresByType application/x-shockwave-flash "access 1 month" ExpiresDefault "access 1 month" # TN - END EXPIRES CACHE
You can Add Expire Headers in the WordPress htaccess file easily. However, It would be good if you set expiry dates for a year. Less than a month or beyond one year is not recommended.
Furthermore, you should add the Cache-Control Headers below the Expire Headers code in htaccess file.
2. Add Cache-Control Headers (Apache)
# TN - BEGIN Cache-Control Headers <ifModule mod_headers.c> <filesMatch "\.(ico|jpeg|jpg|png|gif|swf|pdf|svg)$"> Header set Cache-Control "public" </filesMatch> <filesMatch "\.(css)$"> Header set Cache-Control "public" </filesMatch> <filesMatch "\.(js)$"> Header set Cache-Control "private" </filesMatch> <filesMatch "\.(x?html?|php)$"> Header set Cache-Control "private, must-revalidate" </filesMatch> </ifModule> # TN - END Cache-Control Headers
You can specify timeline in Cache-Control Headers, but it won’t be necessary as you have already set expiry dates for the cached resources.
Finally, you need to Turn ETags Off. You can read more about ETags here.
# TN - BEGIN Turn ETags Off FileETag None # TN - END Turn ETags Off
After that, save your WordPress htaccess file and clear all the cache if you are using a cache plugin.
That’s it, you have successfully enabled Leverage Browser Caching via htaccess.
Do you know that Gzip compression can also increase your website loading speed? Have you enabled it yet? If not, read this effective guide to Enable Gzip Compression in WordPress.
Leverage Browser Caching in NGINX
Now, If you are on Nginx server you can Leverage Browser Caching without using a WordPress plugin by adding following code in the .conf file.
You can find the configuration file at this location… /etc/nginx/sites-enabled/default
1. Add Expires Headers (NGINX)
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf|svg)$ { expires 365d; } location ~* \.(pdf|html|swf)$ { expires 90d; }
2. Add Cache-Control Headers (NGINX)
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf|svg)$ { expires 90d; add_header Cache-Control "public, no-transform"; }
If you have multiple websites on NGINX Server. I recommend you to create a xyz.conf file and add the above-mentioned code. Save this file in this folder /etc/nginx/sites-available/xyz.conf
Reload Nginx server after editing, that is it. Congratulations you have successfully activated Leverage Browser Caching on NGINX Server.
To fully optimize your WordPress site speed you should Remove Render Blocking JavaScript and Defer the loading of JavaScript files. Explore here now!
Leverage Browser Caching WordPress Plugin
Now, let’s have look on the popular Leverage Browser Caching WordPress Plugin. I usually recommend to use the code in the htaccess file rather than using a WP Plugin.
However, here are the three most reliable and popular WordPress plugin to fix Leverage Browser Caching warning.
#1. WP Fastest Cache
WP Fastest Cache is one of the most popular and recommended Leverage Browser Caching WordPress Plugin. This Five Star Rating WP Plugin is available on the WordPress repository for free. As of now, the WP Fastest Cache plugin has more than a million active installations.
- Download and activate the plugin – WP Fastest Cache.
- Go to Settings → WP Fastest Cache
- Select the Browser Caching checkbox and
- Click on the Submit button and you are done.
After that, a message will be displayed “Options have been saved”. Check out the following image for reference.
Congratulations! you have successfully fixed Leverage Browser Caching warning on your website.
In addition to fixing Leverage browser caching warning, this plugin comes with some great features to improve page speed like,
- Enabling Gzip Compression
- Minify HTML and CSS
- Combine CSS files and JS files to reduce HTTP requests
- Furthermore, it can also generate static HTML files of a dynamic WordPress site, etc.
Install the plugin to explore all the available features now.
#2. Cache Enabler – WordPress Cache
Another plugin on the list is Cache Enabler – WordPress Cache. This is a 4.5+ Star Rating plugin. Apart from, browser caching, this plugin has some unique features to speed up your site.
Above all, it is developed by KeyCDN, so you can certainly trust this WordPress Plugin for Leverage Browser Caching. Besides, it does what it says and also compatible with other WordPress performance plugins.
- First of all, Install and Activate the Cache Enabler plugin.
- Go to the plugin setting page.
- Click to Enable Leverage Browser Caching.
- And, that’s it.
This plugin also has many other features, which one should explore, such as…
- Allows you to Automated and/or manual clearing of the cache
- Purge Page-specific cache manually
- It will display the total cache size directly on your dashboard
- Allows you to minify HTML and inline JavaScript
- Also, work with Custom Post Types and many more
#3. W3 Total Cache – WordPress plugin
I am sure that you probably have heard about W3 Total Cache – WordPress plugin. You can also use the W3 Total Cache Plugin to fix Leverage Browser Caching Warning in WordPress.
Follow the steps to fix Leverage Browser Caching warning with W3 Total Cache …
- First of all, download, install and Go to General Settings of W3TC
- Scroll down and Enable the Browser Cache and Save all settings
- Further, navigate for the Browser Cache Settings Tab available on top of the page.
- Specify Cache Headers available in General Settings on this page.
- Set Expires Headers, Set Cache-Control Headers and Set entity tag (eTag) – Check all boxes.
- Save all the settings after that and you are good to go.
#4. WP Rocket
WP Rocket is a premium WordPress plugin, mostly recommended to increase your site speed by bloggers. The WP Rocket not only let you leverage the browser caching but also offers you to optimize your site using various techniques. WP Rocket let you…
- Serve the Lazy Load Images
- Minify and combine static resources like JS, CSS, and HTML
- Serve the static files with Gzip compression
- Allows you to defer JavaScript loading
- Optimize the delivery of Google Fonts
- Add the DNS prefetching meta tags in wp-header to load third party resources faster and
- Let you integrate your CDN platform to speed-up your site.
After installing the plugin, you must remember, that if you do any changes in your theme, especially in the CSS/Stylesheet file. You might not be able to see the changes immediately due to browser cache. So, I would recommend you to open your site in an incognito window each time to see the changes. Here is a complete guide you can follow if CSS Changes not Showing Up in WordPress.
Leverage Browser Caching for Google Analytics
Google Analytics JavaScript file (i.e. analytics.js) is a static resource and it could be cached for any specified time. But Google did not allow to do that because they change the code every now and then to ensure proper tracking.
On the other hand, analytics.js file loads from Google Analytics servers with the Expiring Headers of 2 hours. That is why most of the page speed tools give the warning to cache the analytics.js file.
To leverage browser caching for Google Analytics, you can use the Complete Analytics Optimization Suite (CAOS) WordPress plugin.
The plugin creates a duplicate copy of the analytics.js file, and host it locally on your server. That allows you to serve the analytics.js as a static file. Resulting the fix for Leverage Browser Caching for Google Analytics. Further, the plugin automatically updates the locally hosted analytics.js file after a certain interval via Google servers.
Read our detail guide for the same below.
How to Cache Third-Party Resources
Similar to the use of Google Analytics, we also use many other external services on our website, like facebook widget, google font, any other analytics tool, etc.
These external services load third-party resources with very less expiring time due to various reasons. And you will often notice a recommendation to cache third-party resources.
Well, because we don’t have any control to Cache Third-Party Resources, I would recommend you to use limited or optimized services only. However, you can use the Preconnect link tags in your wp-header to speed-up the loading time of these third-party resources.
To add the Preconnect Link Tag, use the following code in the head of your WordPress site.
<link rel=”preconnect” href=”//fonts.googleapis.com”>
How to Specify a Cache Validator
Specify a Cache Validator, another warning you might have encountered with while testing your site on GTMetrix. The warning is particularly shown for the third-party scripts without specifying the ETag header or a Last-Modified header.
This is quite a similar situation of what we have discussed under the How to Cache Third-Party Resources section. Unluckily, because of the external nature of these scripts, there is nothing we can do to specify a cache validity header.
However, you can always use the Preconnect and DNS Prefetch tags to optimize the loading of third-party resources.
Wrapping It Up
Finally, at the end of the day, it really does not matter how you are going to Leverage Browser Caching in WordPress.
What matters is, did you enabled it or not? If Yes, then open your website in an incognito window and refresh the same page again, you will definitely notice a significant improvement in website loading speed.
Hope you find the list of Leverage Browser Caching WordPress Plugin useful. And manual methods to implement caching must have helped you to improve site speed.
Which method do you use? Do let us know in the comment section below. Or you are using another plugin to Leverage Browser Caching in WordPress.
Feel free to fire your queries or your feedback via the comment section below, I would be happy to answer.
Cheers!
General FAQ
What is Leverage Browser Caching?
Browser caching is a technique to command the browser to locally store the web pages and data for a definite time. The browser will use the locally stored data to render the same website again, which will improve the site loading speed. The method to take advantage of Browser Caching technique to improve your site loading speed called Leverage Browser Caching.
How do I Fix Leverage Browser Caching Warning in WordPress?
You need to install and activate the Leverage Browser Caching – WordPress plugin to Fix the Leverage Browser Caching Warning. The plugin will add code to Specify the Expire Headers, Cache-Control Headers and Turn Off the ETags in your htaccess file.
How do you Leverage Browser Caching for Google Analytics?
First of all, Install the Complete Analytics Optimization Suite (CAOS) plugin. Enter your Google Analytics Tracking ID in the plugin settings page. You Are Done!
In addition to that, you may be interested to read the following tutorials –
Thanks Saurabh..
I used plugin as it was easy to install and it increased score from 84 to 89 on Google Page Speed .
I just want to know if using another plugin will increase load time than editing .htacess?
Thank You.
Hey Gaurav,
Glad that you find this post useful. Looking forward listen more from you.
You can try that yourself too. Thanks for your response.
Hello..
i wanna ask..
yesterday i inserted some code in my .htaccess file.
can i insert/add code Leverage Browser Caching in bottom file .htaccess again ?
btw, sory if my english so bad.
Hi,
Glad that you landed at this article.
Surely you can add code at bottom your .htaccess file.
nice tip i used it on my blog and it working
Hello Pramod,
Glad that I could help.
Thanks for your feedback.
thank you for sharing but dosen’t work for me. gtmetrix results still same
Thanks for you feedback.
Your score might already be good.
Looking forward to listen more from you.
Thank you for the information, it definitely works !
Hey James,
Glad that I could help.
Thanks for your response.
My blog speed score jumped from 64 to 75, Thanks for the lovely information 🙂
Hey Arun,
Glad that I could help. That’s a good improvement. Looking forward to listen more from you.
Thanks for awesome feedback.
Nice information for sharing ….
Hey,
Glad that you find it useful.
Thanks for feedback.
thanks a lot. used the .htaccess and my website increase mobile speed from 60% to 77%
Hey Mathu,
Glad that I could help.
Thanks for your feedback.
Thank you for this tutorial. I’m trying to optimize my website’s speed as best as possible I can. This information is very useful for beginner WordPress webmasters.
Hey Ricardo,
Glad that it was useful for you.
Thanks for dropping by.
Great post. I knew about the first method but was not aware of this plugin. Plugin is easier to use for newbie. 🙂
Hey Deepankar,
Glad that you find it useful.
Thanks for dropping by.
Thanks a lot, I’ve used to have 37 and with this plugin i’m in 62.
🙂
Hey Rossana,
Glad that I could help.
Thanks for your feedback.
This is a life saver! Thanks a lot!
Glad that I could help.
Thank’s alot sir.. i use plugin now my score 95.. wow.. another plugin that helps me to get this score is Above The Fold Optimization, but pain in configuration. but its worth anyway.
95 PageSpeed Score is a great. Keep it up.
Thanks For this Great Article it help us for our Client website
Glad that I could help.
Hi, I have a WordPress blog running in shared IIS server hosting. Is there any plugin that can do the trick please?
Insert the following element under in your web.config file.
WP Fastest cache premium plugin is good
I tried editing the .htaccess file and although I could access the home page, I could not open any of the internal pages???
I used the WP Fastest Cache plug-in and that did help a little.
Think I just need to study this more…
Thanks, interesting blog
I think I know the answer to this but I’d value your comment. I’ve installed w3 Total Cache and activated browser caching, so I see the change from that to the .htaccess file. Previously I had used the standard code you provide above for the Apache server and that code is still in the .htaccess. So I am guessing I should choose one or the other, or is it possibly helpful to have both?
Hey Des,
I would suggest you to choose one method to leverage browser caching. Howevere, keeping both the codes in htaccess dont hurt anyone either.
Thanks for stopping by.
Thanks, it helped my speed score form 85 to 93.
Hey Alan,
Glad that I could help.
Thanks for stopping by.
It would be great if you can add the w3 cache method also in the article.. looking for that update.. thanks 🙂
Hey John,
Thanks for the feedback, i will try to update the same.
My speed score increased from 88% to 94%! That’s huge. My page load time was 1.8s, which is great. Thanks for this post! It was way easy to install and implement.
Glad you find it useful.
Thanks, But pls tell me one thing suppose if I am using the Leverage Browser Caching settings described above in my .htaccess file and somebody opens a page of my site, it will get stored in his browser. And after that if i update the same post or page which is opened by the man, How he will get the updated content? In other words How should I clear the cached copy of my page/post so that the updated post could be accessed by everybody?
Hi Saurabh,
Thank you for posting this solution. I want to ask one thing i have applied this script on my website. But when i check on Google developer i didn’t get any change. The files which were showing earlier have not changed. After how much time i see the effect?
Thanks a lot, I knew about the first method, is there some method to set expires time for other site’s js, like google analytics or some ad system js
hey there,
thanks for this tip, it’s really working on my site.
Wao great article it helps me ….. Thank you
Glad, you find it useful.
superb idea sir i will definetly apply it in my blog. but i am using a home page with demobuilder like shoutmeloud or any proffesional blog. should i apply this to my blog as it can affect user experience please review my blog sachhiprerna.com
It should not affect user experience, use Autoptimize plugin.
Thanks, really helpful!
Thank you for the post. This tutorial helped me to fix leverage Browser Caching warning. Besides, I improved my site performance a lot. My current speed test result is 80.
Regards, Jyoti
Thanks Very good information.
.htaccess method doesn’t work for me. Can you please let me know why?
Even after adding codes to .htaccess file, the same issue for leverage browser caching shows.
Please help me out.
Hi, this code should work. Could you share your website url, on which you are trying to leverage browser caching.
Hi! I’ve copied to the code to my htaccess. Now I have clear all the cache if you are using a cache plugin. What do I do if I dont have a cache plugin?
You don’t need to do anything, server will use the new cache settings from the next time it build the cache.
Actually, as I’m on cloud service I have built in caching. Does it make a difference?
Hi Diana,
It won’t make much difference. However, it may take some time to delete old cache and build new as per the code use used.
Hi
As a novice my pingdom score on leverage is F…
wondering if this will help? Siteground supercache did not in that area particularly but good otherwise. Don’t know if I should try Fastest instead of siteground optimization cache super?
Hey Howard,
You can use this code in .htaccess file along with the Siteground optimisation cache super. It will work flawlessly.
Hi Saurabh K,
I did same thing for my PHP website (www.apnewscorner.com).
I add below code in .htacess file. After adding this code new posts not loading automatically posts only load after click on Ctrl + F5.
# TN Expires Caching Start #
ExpiresActive On
ExpiresByType text/css “access 1 month”
ExpiresByType text/html “access 1 month”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/x-icon “access 1 year”
ExpiresByType application/pdf “access 1 month”
ExpiresByType application/javascript “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresDefault “access 1 month”
# TN Expires Caching End #
please let me know solution for this.
Hey Ramana,
Clear all the website cache and open your site in incognito window after that. New posts will start appearing automatically.
Works great
Hey,
Glad that I could help.
Thanks for stopping by.
thanks for sharing. Very useful content.
Thanks for the information.
I can’t seem to get rid of the render blocking message when I do a speed test.
I’ll try some of the suggestions here.
Hey,
Glad, you find the information useful.
You may want to read this article to remove render blocking message. https://technumero.com/remove-render-blocking-javascript/
Thanks
Very good article
I mostly use W3 Total Cache + WP Performance Score Booster.
Editing .httaccess method is perfect.
Hi SAURABH,
I was unable to realize the matter as well as I was looking for a complete solution for cache guideline. Now, I have got you and it’s really the total solution for applying it on the websites.
I have already installed WP Fastest Cache and now it is the time to see what happens.
Thanks a lot for providing a great tutorial. Have a nice day and thanks a lot. 🙂
Thats for the article! I was having a problem with google speed test and Leverage browser caching so Im going to use your advice and hopefully that will help. Thanks again!
Grato por sua aula.
I tried using the W3 total cache plugin. But this is not working. I don’t know why this happens?
Leverage browser caching to make your webpages faster. If you can leverage browser caching, you can increase website speed considerably. Thanks for sharing this great information to all of us.
Thanks, Man! You saved my Life <3
what is the difference between Cache-Control Headers and Expires Headers?
is it important to put both of them in .htaccess?
thanks for sharing this article.
Hi Sourav
Thanks for sharing the Tutorial. I have followed the htaccess method. Worked Fine. Thanks
Hi,
I need to know how to speed up my Website. At present, my website load time is 16.64 s. How can I reduce and make faster? Please help me.
Website platform wordpress
Hey Ramya,
You can take following steps to speed up your site.
1. Leverage Browser caching
2. Remove Query Strings
3. Minify HTML, CSS and JavaScript
4. Optimize website images
5. Defer JavaScript Loading
6. Use Web Safe fonts instead of Web Fonts
What element?? I don’t see what you are referring to
Hey Saurabh!
Thanks for the trick, it saved me from installing a caching plugin to leverage browser caching. My Pingdom rating is now up to 87 and I reduced my page speed with a whopping 3 seconds. It is now much faster. I used the .htaccess method.
Cheers!
Glad! I could help. Thank you for stopping by.
Here is the solution if you are on IIS.
Thank you sir very good article.
Hello i used both the method adding codes to .htaccess file and using WP total cache but still it shows the error of leverage caching
Very best content, I impressed with you.
Hi, is it useful to adjust both – the .htacces file in cPanel and install a Plug-In?
How to increase website loading speed please provided information and how to speed up newspaper theme.
When you add the additional code in the .htaccess file, how long does it for GTmetrix to analyze the changes?
It should not take any time. Just remember to clear the cache, if you are using plugin. And try to test website on GTmetrix in a incognito browser window.
Is there any plugin available for fix laverage browser caching problem in WordPress
my website speed not increased even by a single percent. Everything was applied as you said. But no effect
Hi Rahul, Sorry to hear that. However, there are many other factors which affect site speed. Pl share the specific details, I would be happy to help.
Great tutorial. I was facing slow speed issue on my blog and applied the suggested codes in my .htaccess file. It brought some improvements in the loading time. Thank you so much,
Hi,
in Googles PageSpeed Insights my website gained 4 points for Mobile and 3 points for Desktop with your code, plus Google is suggesting to use browser caching also for the following resources:
https://maps.googleapis.com/…........&ver=3.14 (30 minutes)
How can I integrate this suggestion into you code?
Try to defer the loading of Google Map files to improve performance. Google Maps APIs are set with 30min expire headers, we can’t change that, until we host those API files.
Good Article! Levrage Browser Cashing really help to load the website faster!
Dear Saurabh K
Where is wp super cache?
Hey Saurabh that an excellent article man
Thanks for the amazing trick !
You manged to reduce my site speed 🙂
Glad! I could have helped. Thanks for stopping by.
Hi I was used codes in .htaccess but the speed still low
Hi Beyan, There could be other factors for slow site speed. Pl explain other details.
can you tell me any way to speed up my website
Hey Rishabh, you can implement other htaccess for more speed.
https://technumero.com/increase-page-speed-using-htaccess-wordpress/
Thank’s a lot Saurabh……good article..now my page speed score is 91
Great! You can get score more than 91. Try to implement htaccess hacks for speed optimization.
https://technumero.com/increase-page-speed-using-htaccess-wordpress/
i used wordpress plugin for browser cache after your recommendation and it works best
Thank Raj for stopping by. Glad, I could help.
Website speed really matters. Thanks for your codes for leverage browser caching on wordpress it helps me to increase my wordpress website speed.
It would be great if WordPress.com offers free plugins the same way as WordPress.org
At the moment, even a personal plan does not cover plugins, thus the only way to leverage brower caching is via coding.
Thank you anyhow for creating such a comprehensive guide to leveraging browser caching, it is much appreciated.
That was great! You really leverage browser caching those assets!
Great to see it works. Thanks for stopping by.
I’ve been a WP user for ages, and I’ve had Cache Enabler, that works for me.
But what you’ve shared here are all very effective too!
Thanks again!
Thanks for the guide, I just have one question
will this mess with Adsense codes?
Sorry, I am new so I don’t have much idea about this.
Browser caching is for internal resources. It does not affect the Adsense code.
Thanks for the tips. I implemented them and managed to improve my site speed substantially. By the way, I really like the sticky floating post share bar in this post. Which plug-in are you using?
Glad, you find it helpful. It is a custom plugin we use for the social share buttons.
Thank you for stopping by.
Thanks for providing in-depth article on Leverage Browser Caching for website. I am using WP fastest cache plugin for my website, I have noticed a bit of improvement in website speed not what I had expected. Some Plugins itself a heavy resource on web servers. So this time I am going to implement Browser caching without plugins. I hope this would work out!
Did it work for you?
Add Expire Headers code working for me
Thanks for your nice tutorial
I have a problem, I am using WP rocket pro but my website still showing, The Leverage Browser Caching Warning. I do not know, what should i do now.
Please suggest me
Thanks
Hey Tanmoy,
Just use the above code in your .htaccess file. It will remove the Leverage Browser Caching Warning for all the static resources of your site.
However, there are many other things you should consider to improve your site performance. Minification, defer JS, lazy loading, etc. Feel free to read our tutorials on the same.
The article has extremely quality content, I appreciate it, your article will surely bring a lot of useful knowledge to everyone. respect you