How-to 7 min read

How to reduce the number of HTTP requests

HTTP requests send a message to the server that the user sends. They are reduced by combining components, pictures, caching, separation of components by servers, and other methods.

What are HTTP requests and why do they need

HTTP requests are the protocols with the help of which data is exchanged on the Internet during client-server interaction. The browser sends these protocols when displaying web pages. While responding to a request, the server sends the appropriate files. That is, an HTTP request is a request from the browser to the server.

By showing the user a simple web page on a site, the browser can send up to a dozen requests. Below is an example where 4 HTTP requests were sent when the page was displayed:
HTTP requests in page code

Why does the speed of loading documents decrease due to HTTP requests

Increasing the amount of data

During the download, the value of the response header and the amount of transmitted data are important. Headings usually include:

  • web browser version;
  • supported data formats;
  • desired language for displaying content
  • selected compression algorithms;
  • information about the selected encoding;
  • cookies
  • POST / GET information, etc.

Up to 40 requests can be sent to download colorful, thoughtful web pages. And if about 1000 bytes are required to show one component, then the total size will be up to 40 000 bytes or 40 Kb.

How to calculate the number of HTTP requests when loading web pages

The indicator can be viewed in browsers.

Mozilla Firefox

In Firefox, use the extension Firebug. It is effective, but in most browsers there are built-in analogues that have no less effective functionality.

To use the extension:

  • go to the "Network" section;
  • refresh the web page;
  • check the number of requests below.
Number of HTTP requests in Firebug plugin in Firefox

Opera and Google Chrome

These two web browsers have built-in counting tools. To use them:

  • open your website in them;
  • right-click anywhere in the document and select "Explore Component";
  • go to the "Network" tab;
  • refresh the web page to see the exact number of requests below.

How to reduce the number of HTTP requests

Combining components

By combining components for downloading into a single file, specialists reduce their number. Consequently, the number of HTTP requests is reduced. If 3 stylesheets and 4 JavaScript scripts are connected, 8 requests will be sent (7 + 1 for HTML code).

To minimize the indicator, it is enough to collect style sheets in one file, and libraries in another. So the number of requests will decrease from 8 to 3.

You can use special tools, for example, Minify. By the way, the application minimizes not only statics, but also HTML. It is written for PHP.

When combining JavaScript scripts, you may encounter difficulties with those scripts that use the method document.write to display part of the text.

To eliminate the inconvenience, you have to modify these sections of code by removing document.write. Or do not combine such a script with others.

Combining SVG images

SVG is a special vector graphics format. The advantage of the format is that it can be edited in standard editors, but it will also be textual. This means that it can be opened through any code editor text.

For example:
<svg width="20">
  <rect fill="#fc0"
  <line stroke="black"
    x1="0" y1="0"
    x2="20" y2="20"/>
This format is suitable for graphics that design content.

Previously, the method was popular CSS sprite. With it, to load the required component of the web page, the properties background-image, background-position were used.

One of the options for using CSS sprite:
Using CSS sprite to combine images
They made such pictures manually or through spritegen. But this technology is already outdated; more and more webmasters prefer SVG images. The main reason is precisely that the images are set only of a certain size, but for the "rubber layout" this is not relevant.

This technology has disadvantages:

  • The development process is becoming more complicated. A mile of the page, it is necessary to consider differences of elements when displaying in different browsers.

  • The upgrade process is getting more complicated. If you need to remove or modify one graphic component, you have to edit the entire picture.
  • There is a risk of slower page loading. This happens if sprites are applied incorrectly.

  • CSS sprites are missing their URLs. If a visitor displays a graphic in a web browser, nothing will load in the place of such images.


To implement this method, the information on the server must match the cache data. As most of the downloadable components are static, a declarative expiration date is used as a suitable caching method.

To enable the mode, just put the .htaccess file in the www.domain.tld / res / folder with the instructions:
htaccess caching
In this case, the file will not be reloaded from the server until the date selected in the third line.

Distribution of components between servers

The speed of display of elements is limited by the bandwidth of the data channel. To speed up the process, you can use parallel downloads.

What else affects the number of HTTP requests

Plugins can affect metrics. Each of them has its own styles and scripts. Plugins register links to these elements to each web page, which increases the number of requests.

The following shows how this happens with the WP Subscriber Form plugin as an example:
Impact of WordPress Plugin on HTTP Requests
Custom CSS and JavaScript files can contain themes.


HTTP requests are an integral element of data transfer during client-server access. If web documents load too long, visitors can leave them without waiting for the information to be displayed. To reduce the latency of downloads, minimize requests.

The most popular ways to reduce HTTP requests:

  • combining elements — style sheets, JavaScript libraries;
  • association of pictures;
  • Inline pictures;
  • caching
  • distribution of components between servers.

This article is a part of Serpstat's Checklist tool
Checklist at Serpstat" title = "How to reduce the number of HTTP requests 16261788332123" />
Checklist is a ready-to-do list that helps to keep reporting of the work progress on a specific project. The tool contains templates with an extensive list of project development parameters where you can also add your own items and plans.
Try Checklist now

Speed up your search marketing growth with Serpstat!

Keyword and backlink opportunities, competitors' online strategy, daily rankings and SEO-related issues.

A pack of tools for reducing your time on SEO tasks.

Get free 7-day trial

Rate the article on a five-point scale

The article has already been rated by 0 people on average out of 5
Found an error? Select it and press Ctrl + Enter to tell us

Share this article with your friends

Are you sure?

Introducing Serpstat

Find out about the main features of the service in a convenient way for you!

Please send a request, and our specialist will offer you education options: a personal demonstration, a trial period, or materials for self-study and increasing expertise — everything for a comfortable start to work with Serpstat.




We are glad of your comment
I agree to Serpstat`s Privacy Policy.

Thank you, we have saved your new mailing settings.

Report a bug

Open support chat
mail pocket flipboard Messenger telegramm