Leverage Browser Caching

When a webpage loads on your screen there are a lot of little pieces that have come together to create what you’re seeing. Your logo, other images, style sheets, javascript files are among some of the external resources a webpage might use to render itself on your screen. Generally, each time you load the page, every one of those resources has to be requested again, and served up to render the page.

Enter Leveraging Your Browser Caching.

A cache is a set of stored resources for your webpage/website. It holds those elements (external resources) in the browser so that the next time the page needs to be rendered a separate request does not need to be initiated, the browser already has those elements handy to render up the page for you. This makes pages much faster and increases the quality of the user experience … particularly on mobile. There are a number of different ways to leverage browser caching. Most common is through use of an .htaccess file. This file tells browsers what elements and resources to cache, and for how long. It may look something like the following.

## 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 ##
 

This would tell the browser to hold on to some elements (images) for a year and other files for a period of 1 month. It is important to note that when caching your external resources you will want to clear that cache when you make any changes to the website. If you don’t, the changes might not be served up when the page is called until the cache expires. For instance, changing a jpeg image on the site with a new one won’t redner for anyone that has a browser recognizing that jpegs are cached for 1 year. After that year, they’ll see the image change.

More Web Design Blog Content

New Mobile SIte

Head on over to livewiregeeks on your mobile device It’s our new mobile site based on Chalis iwebapp – a powerful framework that works well across the board. Livewire mobile has everything our main website has but is built for mobile devices. A custom redirect script detects whether a

Not All Backlinks Are Created Equal

Improving SEO Results with Link Building. Still trying to get higher SERP (Search Engine Results Page) placement? After months of trying is your company no higher on Google or Bing than before you concentrated on SEO keywords? The lack of results from your efforts may leave you confused

Understanding Value

At Livewire, we definitely understand what value means. As primarily a B2B driven business we know that value goes beyond a ROI, although that is incredibly important. A proper return on investment is the measuring stick by which most business owners value our services, and that is totally

Client Spotlight: Pye Law

Tom Pye is a heck of a guy. Dedicated to his clients and serious about his business. He chose Livewire, the best Gainesville web design team in the businesses to create and promote his online presence. We remade his website and optimized it to the hilt. In just

JW Freeman Plumbing Has A New Website

JW Freeman plumbing is a new client with lots of potential. He needs something that will put him on top and Livewire is that something. We have tons of experience and dozens of happy clients that proves we have the formula for success. We don’t keep it a

Date for our next Seminar is 4/8

Livewire Seminars are the perfect way to collect everything you need to know to do your own website optimization. We have what it takes to put your site on page 1 and we’ll teach you all of the not-so-secret info. Where to go, what to do, and how