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

Messaging When Switching From iPhone to Droid

Sneaky little issue pops up when you move away from iphone. Other iphone users that previously texted you won’t be able to text you the same way once you switch. This is because when you both were using iphones, the messaging system was not the typical SMS, but

How important is color in web design?

Color is an extremely important aspect of web design. It can have a significant impact on the user’s perception of a website, its brand identity, and the overall user experience. Here are some reasons why color is important in web design: Branding: Colors can be used to create

New Website: Top Dawg Detection

Bed bug detection is a fascinating new business. Trained in a facility up north, these dogs are trained to detect even a single bed bug. Most of the business is certifying hotels and motels as “bed bug free”. These dogs are about 97% accurate and are fun to

Even More Internet Marketing Success

We’ve been working with attorneys all over town. None more than Fisher, Butts, Sechrest and Warner. They’re great folks located over in Haile. They have a successful law firm and are enjoying much success online. When we met, they were basically nowhere online … maybe somewhere back on

Content Marketing Mistakes That Derail Your SEO

Don’t fall into the trap of content which won’t rank on search engines to go along with your sites top-flight graphics. All the effort and money poured into your website is for nothing if you don’t rank on a search engine. These are some common mistakes that can

How To Survive A Good Google Dinging

This is a great demonstration of what can happen with unnatural linking schemes and getting hosed by using link farms. This company did some black-hat SEO and it came back to bite them. Luckily the article shows that it is possible to recover from a Google update nightmare, but