How to leverage browser caching to speed up a website

Browser caching helps a webpage load up quicker. It helps your browser "remember" the resources it loaded before - saving them in its memory (called a cache). This helps with visual-heavy elements like logos, graphics, pictures and scripts and reduces the loading time of a webpage.
Arp Laszlo
Business Technology, Marketing, Search Engine Optimization (SEO), Tutorials, Website Help, WordPress

Speeding up a website can be a chore. One of the easiest ways to speed up a website is to leverage browser caching.
Browser caching helps a webpage load up quicker. It helps your browser “remember” the resources it loaded before – saving them in its memory (called a cache). This helps with visual-heavy elements like logos, graphics, pictures and scripts and reduces the loading time of a webpage.
This results in a smoother and faster browsing experience after the first time you visit a website. The first time the browser ‘sees’ and captures resources in its cache. The next time(s) you visit the site, the page will load faster because the browser doesn’t have to download cached resources again.

How to test your website’s speed

You can see how fast your  website is at any of these websites:

At each site you can enter your website’s url and they will give a report on your site within a few minutes. They will have a number of suggestions on things to improve – for this tutorial, look for the words leverage browser caching. You’ll see a grade or recommendation on whether you need to leverage browser caching or not.
How to leverage browser caching to speed up a website

How to leverage browser caching

Browser caching can be enable by editing a file on your web server called .htaccess. Locate it by going to your website host’s file manager or via FTP (file transfer protocol). Please be advised that the .htaccess file controls a number of important server settings. Deleting the wrong thing or leaving text/punctuation in the wrong spot can result in site downtime.
We then need to add some code that tells browsers what to ‘remember’ and how long to remember it.
Add the code below to the top of the 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 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 ##

Then save the file and refresh your webpage. If you run speed tests again, you will need to test 2 times to see the improvement.

Modifying Caching Times for Your Website

Caching does not last “forever”. Specific  time periods like “1 year” or “1 month” are shown in the example above. They are attached to certain file types like .jpgs or gifs.
Of course, you can change the cached values for the above code. For instance, you just replace “1 year” with “1 month”, or vice-versa. The choices above are ideal for most websites but your unique needs may be different.

One issue to watch out for

If a file is cached for one year it means that changes may not be seen by all visitors. This is because they may see cached files instead of updated ones. If you have file that you tweak occasionally (like a stylesheet to edit site colors or fonts) you can overcome the cache issue by using URL fingerprinting.

Solving Caching Issues with URL Fingerprinting

URL fingerprinting simply means renaming an updated file. For instance, instead of having main.css, you could rename it to main_1.css. If you update the latter, then you can always call it as main_2.css, etc.

We enable browser caching for all of our clients.

Have you found this helpful? Let us know in the comments!

Recession Business Strategies: Lessons from Businesses Started in the Great Depression

In the U.S.’s darkest economic time, 90% of businesses went under during the Great Depression. But, a special group of entrepreneurs saw the downturn as ...
Arp Laszlo
Why Tough Times Breed Great Businesses — And How You Can Thrive Today bricks and clicks marketing greensboro durham raleigh nc

Why Tough Times Breed Great Businesses — And How You Can Thrive Today

The Counterintuitive Truth About Business Success It might seem strange but some of the top businesses started when times were tough. This isn’t just luck. ...
Arp Laszlo
What are the top 3 Google SEO ranking factors?

Paid Search Demystified: What Every Small Business Owner Needs to Know

In today’s competitive digital marketplace, understanding how to effectively reach your audience can make or break your business. Paid search advertising offers a golden opportunity ...
Arp Laszlo

2 thoughts on “How to leverage browser caching to speed up a website”

  1. Nice post!
    Cache is too often neglected event though it’s can really help speed up website for returning visitor.
    To check your cache policies, you can also use dareboost.com, it give you advanced tips according to the technologies used by the website analysed.

  2. Thanks Yoann. I hadn’t heard of Dareboost before but just checked them out. As pretty as their info looks, I don’t like their approach because they don’t seem to have an option for viewing historical data. Browser caching only shows in the results the 2nd time a test is run and both test results looked identical at Dareboost.
    They are also extending into non-performance territory with html & css validation – which is nice but not necessary if we are strictly focused on performance. I still recommend Pingdom & GTMetrix for more accurate results regarding page performance.

Comments are closed.

Check out our Search Engine Optimization Services page for details on how we can get you more organic traffic, more leads, and more conversions.

Learn about our SEO services

Why Work With Me?

Unlike big agencies that offer cookie-cutter solutions, I provide personalized, hands-on service that fits your specific needs.

Tailored for Small Businesses – I focus on what works for YOU, not just industry trends.

No Middlemen, No Bureaucracy – You work directly with me, so you get fast, personal support.

Proven Strategies That Get Results – I don’t just “do marketing” or “build websites”—I create solutions that drive revenue.

Ready to take your business to the next level?
Let’s talk!
Schedule a free consultation