How to Reduce Your Website’s HTTP Requests

How to Reduce Your Website’s HTTP Requests

So, what exactly is an HTTP request? What are HTTP Requests? The browser requests that your server send over a file containing content associated with that page. Why HTTP Requests Affect the User Experience There are two reasons HTTP requests can affect your website's user experience: the number of files being requested and the size of the files being transferred. The more files on your website, the more HTTP requests your user's browser will need to make. For example, Google Chrome's API can tell you precisely when the HTTP request for an image started, and when the image's final byte was received. This will help reduce the time it takes to make a HTTP request, thereby reducing load time. To compress your images to their minimum, use a tool like Squoosh, a tool developed by Google to shrink image file sizes at the slight expense of image quality. Cutting and compressing images are a great first step to reducing HTTP requests and page load time. Every CSS file you use for your website adds to the number of HTTP requests your website requires, thereby adding time to your page load speed.

How to Turn Leads into Clients with Modern Email Marketing
How to Monetize Every YouTube Video
How to Conduct a Social Media Audit (Includes a Free Template)
make-fewer-http-requests

Every time you surf the web, a whole bunch of technical stuff happens behind the scenes to deliver content to your screen.

Engineers are usually the ones managing these activities. Marketers, even those with technical chops, tend to shy away from it. One of these activities is an HTTP request, and it’s actually not as complicated as you might think. In fact, marketers need to have at least a general understanding of the actions their own website performs each time a person visits it.

The metrics marketers tend to be responsible for can depend heavily on how the backend of a website is developed. For example, a high number of HTTP requests by your webpage can slow down the page’s load time, which ultimately damages the user experience. This can cause your visitors to leave the page more quickly if it doesn’t load fast enough (which increases your
“bounce rate”).

HTTP requests can affect numerous key metrics that determine how engaged your audience is with your business.

So, what exactly is an HTTP request? How does it affect the user experience? And what can a marketer do to reduce their website’s HTTP requests? Let’s go through each of these questions one by one. By the end, you’ll have a better grasp on why these response protocols matter, and what you can do to give your website visitors a better, faster experience.

What are HTTP Requests?

HTTP requests happen when a web browser sends a “request” to your website’s server for information on a webpage. When a user visits a page on your website, your server heeds this request and returns the files contained on that page to the user’s browser. The fewer HTTP requests a website has to make, the faster the site can load.

Each time someone visits a page on your website, here’s what typically happens:

  1. The person’s web browser (popular browsers include Chrome, Firefox, and Safari) sends a request to your web server. Your server hosts the webpage they’re trying to visit on your site.
  2. The browser requests that your server send over a file containing content associated with that page. This file may contain text, images, or multimedia that exist on your webpage.
  3. Once the person’s browser receives this file, it begins to render your website on the person’s computer screen or mobile device.
  4. If there is more content on your webpage the browser has not yet received, the browser will send another HTTP request.

The above steps describe a single HTTP request, from ask to answer. HTTP stands for “Hypertext Transfer Protocol,” which is just a fancy name for a web browser sending a request for a file, and the server sending (or “transferring”) that file to the browser.

Why HTTP Requests Affect the User Experience

There are two reasons HTTP requests can affect your website’s user experience: the number of files being requested and the size of the files being transferred.

A web browser needs to make a separate HTTP request for every single file on your website. If your website doesn’t have many files, it won’t take very long to request and download the content on your site. But most good websites do have a lot of files.

The more files on your website, the more HTTP requests your user’s browser will need to make. The more HTTP requests a browser makes, the longer your site takes to load.

The size of the file being transferred is also a factor in how long a page may take to load on a user’s screen. And just as the files on your computer have various file sizes — measured in bytes (B), kilobytes (KB), megabytes (MB), and so on — so too do the files embedded on your webpage. Big, high-definition images are a common culprit of large file sizes.

In other words, the larger or higher definition the content is on your website, the larger its file size is. The larger the file size, the longer it will take to transfer it from your server to a user’s browser.

The longer this file is it transit, the longer a user’s browser has to wait before it renders this content on his/her screen.

How HTTP Requests Affect the User Experience

A long load time can be a disruptive and frustrating experience for your users. Mobile users will have a particularly bad experience, as most of them will have to wait until every asset on a webpage is downloaded before the page even begins to appear in their mobile browser.

And research shows load time matters when it comes to website performance. According to data from Pingdom, a website performance monitor, a page’s bounce rate can soar from 9% to a whopping 38% if its page load time increases from just 2 seconds to 5 seconds. This is because lots more people “bounce” from your website during that three-second delay.

So, what’s the magic number of HTTP requests a website should aim for? The answer is not “one.” Some people think they can solve the problem by only using one JavaScript file to control their entire website. But remember: File size affects load time, too. For complex websites, that one file can be an incredibly long trip from your server to your audience’s browser.

Although there isn’t necessarily an optimal number of files your webpage should be reduced to, HubSpot’s principal product marketing manager Jeffrey Vocell suggests aiming for between 10–30 files.

For most top-performing websites, getting there is difficult and generally requires dedicated engineering resources. As of March 2019, the median number of HTTP page requests to load a webpage on mobile or desktop was between 69 and 75 requests.

How to Make Fewer HTTP Requests to Your Website

1. Grade your website’s performance to find the root problem.

If you’re starting from scratch, with no idea how your website is performing, you’ll first want a detailed report of your website’s overall health. To get this report, check out HubSpot’s Website Grader.

website-grader-http-requests

COMMENTS

WORDPRESS: 0
DISQUS: 0