How to reduce the number of HTTP requests
What are HTTP requests and why do they need
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:

Why does the speed of loading documents decrease due to HTTP requests
Increasing the amount of data
- 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
Mozilla Firefox

Opera and Google Chrome
- 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
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
For example:
<svg width="20">
<rect fill="#fc0"
width="20"
height="20"/>
<line stroke="black"
x1="0" y1="0"
x2="20" y2="20"/>
</svg>
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:

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.
Caching
To enable the mode, just put the .htaccess file in the www.domain.tld / res / folder with the instructions:

Distribution of components between servers
What else affects the number of HTTP requests
The following shows how this happens with the WP Subscriber Form plugin as an example:

Conclusion
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

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.
Cases, life hacks, researches, and useful articles
Don’t you have time to follow the news? No worries! Our editor will choose articles that will definitely help you with your work. Join our cozy community :)
By clicking the button, you agree to our privacy policy.