HTTP Requests: Reduce them For Better Performance
The new rule of thumb is that you have about two seconds from the time the searcher clicks your link to grab his attention or he’s going to leave your page. Count it out in your head – “one thousand one, one thousand two…Click!” Not much time, is it? Now, how fast is your blog loading? Because that’s two seconds from the time he clicks your link – NOT two seconds from the time your blog finally comes up on his monitor. If it’s taking your blog too much time to load, you can reduce the HTTP requests to improve your performance.
Maybe you’ve never taken a look at the internal coding on your blog, but it’s time. Especially if it takes forever for your blog to load.
Each time someone loads a page of your blog, every single aspect that has an HTTP involved has to reload, too. And when you take a look under the hood you’re going to be amazed out how many items fall into that category.
- Your header requires a separate HTTP request
- If you have a background image it requires a separate HTTP request
- Navigation images each require a separate HTTP request
- Each image has its own URL and requires a separate HTTP request
- Each ad banner has its own URLand requires a separate HTTP request
- Scripts may have several URLs and require separate HTTP requests
As you can see, a large blog or website could have literally hundreds of HTTP requests that have to be filled each time a new page is requested.
When a visitor first arrives on your blog, each one of these HTTP requests has to be loaded. And then, each time your visitor clicks on another post or page, all of those items have to reload all over again. In most cases the load time for each element is only a tiny fraction of a second and in a brand new blog you won’t even notice it.
But once your blog starts to grow, those micro-seconds start to add up. Consider this: While the average searcher has about a two-second attention span, the average blog takes more than three or four seconds to load. How much traffic are you losing because your load time is dragging?
How can you reduce HTTP requests?
The best thing you can do to make a big difference quick is get rid of all that cluttered and disorganized HTML and use CSS stylesheets instead. HTML is old-hat, at least as far as coding entire websites. Elements get lost in the shuffle, they’re littered throughout the code, and it takes time to read each of those little bits that aren’t even being used.
CSS is cleaner, more flexible and easier to use and it greatly improves your load time. It also allows you eliminate a few of those HTTP requests, but more important, it allows them to load in a more orderly fashion.
Combining stylesheets so that everything loads at once also eliminates requests. Instead of loading four or five stylesheets separately, combine them onto one page. Along with reducing HTTP requests you’ll also be reducing access times and making your blog more efficient.
Put scripts at the end of your code. When the browser hits a script element it stops what it’s doing and goes to fetch the entire script before it finishes loading your blog. Since you typically don’t use that many scripts, put them at the end of your CSS so they don’t interrupt the load.
Use CSS sprites to combine images and reduce HTTP requests. Take a look at the main images of your blog, the ones that never change – the header, the background image, and navigation buttons. Using a sprite generator it’s possible to combine all those images into one piece of code that generates only one HTTP request.
When you're learning how to make money blogging, you need to understand that the very first step is to create a website. If you're interested in starting your own blog, I have written a step-by-step guide that will show you how to start a blog for as little as $3.49 per month (this low price is guaranteed only through my link). You will also receive your own domain name for free ($15 value) by clicking on this link and purchasing at least 12 months of hosting with BlueHost. Keep in mind that if you're learning how to make money with a blog, the first thing you need is your own self-hosted website. It will help you look more professional in front of your visitors, clients, companies, and everyone else.