Do you want to reduce HTTP requests in WordPress?
Speed is an essential aspect of SEO and an ideal user experience. According to research, sites that load in five seconds (compared to those that load in 19) see 70% longer average sessions.
You can increase the speed of your WordPress website if you reduce HTTP requests.
In this post, I am going to tell you the various ways that will help you to cut the number of HTTP requests.
- What are HTTP/S Requests?
- HTTP vs HTTPS
- Importance of tracking of HTTP Request
- Tools to Track HTTPS Server Requests
- Reduce the Number of HTTPS Server Requests
What are HTTP/S Requests?
When a person opens any page on the browser, the browser sends a request to the webserver for the files needed to open that web page. The data are made up of HTML, CSS, JS, images, text, and other web elements.
This request sent by the browser is called HTTP Request or Hypertext Transfer Protocol. When the server receives the HTTP request, it reads the message and responds with the files that the user is asking.
The browser receives the file from the server and opens the files on the screen as a web page.
This is how a web page loads, and all of it happens in a matter of seconds.
HTTP vs HTTPS
The HTTP and HTTPS are mostly similar. The major difference is the SSL certificate.
When the data transfers via HTTP, the files are written in text format. Data sent and received via HTTP is easily readable. Its plain text format.
One only has to do a men-in-the-middle attack or any other way to capture the files.
On the other hand, HTTPS has SSL installed. SSL is a security certificate that encrypts the data, and only the webserver and the browser can read it by matching the keys.
HTTPS is HTTP with security.
Even if a hacker captures the files, he will never be able to make any use of it, as it is in encrypted form. He will find the gibberish in the data.
Read our guide for the difference between HTTP and HTTPS.
Why is it so important to keep track of HTTP requests?
It is important to keep track of HTTP requests because every single visit to your site means that the browser has to make a separate HTTP request for every single file.
If there are lots of files and elements on the web page, there will be more HTTP requests. That means more time to load the web page.
Having a fast loading site is beneficial for business, SEO, and user behavior. But many site owners keep adding the new element (images, gif, video, external script, etc.) to the page that makes the page heavy.
As a result, the number of requests increases, and the speed of the site slows down. You can improve the loading speed of your website by reducing the HTTP requests in WordPress.
Tools to Track HTTPS Server Requests
Many tools can help you to find all the HTTP requests your webpage is making. And all of them are free.
Google Chrome Developer Tools
The developer tool provided by Google Chrome offers a lot of information about any given website. Just load the site on the chrome and open the Developer Tool.
Shortcut: Ctrl + Shift + I
A box will open on the right side of the display. Click on the Network tab, and you will find all the HTTP requests. If there is none, just reload the page, and you will see them.
You can know more about each request by clicking on it.
But the developer tool is for developers, and it is a little bit complicated.
Google PageSpeed Insights
This is another fantastic tool provided by Google. It is not specifically for the HTTP request, but to find the speed optimization possibilities on the site.
Once you put the URL and run the test, the PageSpeed Insights tool will open up a report.
In the report, you will find the speed errors, and the tips to improve the web site performance.
GTmetrix is a popular speed test tool for WordPress sites. It also offers a performance score for your website, which depends on the various factors.
Enter your web page URL to the GTmetrix, and it will run the test.
GTmetrix tells you a lot about the page and how you can improve the speed of the page.
To find the HTTP request, click on the Waterfall tab. It will open up the list of all the requests sent by the web page.
Click on anyone to read more about the request. You can know the time taken by the server in resolving the request and sending the response.
You can read the GTmetrix speed test guide to learn how to do the test with GTmetrix.
Similar to GTmetrix, Pingdom is also a fantastic tool to run speed tests for the WordPress site.
Once you run the test, it will give you a performance report. And below, you will find the improvement tips for the site.
Besides the site assessment, you will find the waterfall chart on the page when you scroll down.
You can sort the request by the size, load order, load time, etc.
By doing this, you will know what request is taking more time, and what requests are large. Then you can deal with them accordingly. Read the Pingdom Speed Test Guide.
Reduce HTTPS Requests in WordPress
Now you know if your web page is making so many HTTPS requests. The ideal solution is to find out the real problem and then solve it.
These speed tests are enough to tell you what HTTP request is halting the speed of the website. But there are general methods to reduce the HTTP request in WordPress that you can implement.
Methods to Reduce HTTP requests in WordPress are:
- Delete Unnecessary Images
- Optimize the Images
- Create a CSS Image Sprite
- Lazy Load the Image
- Delete Unnecessary Files
- HTTP Pipelining
- Using a CDN
- Check the HTTP/2
Delete Unnecessary Images
Yes, images are necessary for an attractive web page.
But that does not mean you should use them liberally. The images are large files, and they increase the weight of the whole web page.
If there are images on your site that serve no purpose, maybe you should remove them entirely because those images slow down your WordPress site.
Optimize the Images
After removing the unnecessary image, the remaining image should be optimized. It means you should compress the image for the web.
You need to reduce the size of the image by minimizing the size in bytes of the images. With this, the image loses the quality, but it loses the extra weight of pixels.
- Smush Image
- EWWW Image Optimizer
- ShortPixel Image Optimizer
- Compress JPEG & PNG Images
You can also reduce the size of the image before uploading it to the site. It is your wish how you want to do it, but the important thing is to optimize the image for the web.
Create a CSS Image Sprite
What CSS Image Sprite does is so simple yet but amazing.
If there are five images on your web page, then it means five separate HTTP requests for each image. With the help of CSS Image Sprite, you can bundle those five images into one, and then there will be only one HTTP request instead of five.
CSS Image Sprite reduces HTTP requests in WordPress by combining the multiple images into a single one. In the front ends, visitors notice nothing, but the browser has to work less.
But CSS Sprite is not for everyone. There are few drawbacks to this technique too. You should implement it carefully.
Lazy Load the Image
Lazy Loading means loading the image when it appears on the screen. Instead of loading each and every element of the entire web page, the site loads only those images that are appearing on display.
As the user scrolls down the web page, the rest of the image will load too. Lazy Load does not reduce the number of HTTP requests but allows them to parse one by one.
WordPress Lazy Load plugins:
- Smush Image Optimization
- a3 Lazy Load
- BJ Lazy Load
- Lazy Load
- Crazy Lazy
Delete Other Unnecessary Files
After the images, you should also evaluate the various files on your web page. Are they necessary?
Files such as:
- Social Media Feed
- Embedded Video
- Unnecessary Gif
- Embedded Tweets or Instagram posts
- Java Scripts etc
This site has this revolving globe on its widget that tells the location of the current visitor.
It’s interesting, but still a heavy script to add to the site.
If you don’t need a file on your web page, remove it. It includes deactivated plugins, themes, and other extensions. They keep running in the background and keep adding the HTTP requests.
Then there are so many third-party apps. Run a GTmetrix speed test, and find out all the third-party HTTP requests. You cannot make any changes in those requests; they will load at their own time.
For the third party scripts, evaluate which one you are using.
- Delete: If you are not taking advantage of the script, remove it from the site.
- Change: Find the alternative that is much faster than the one you are using.
Overall, find the balance between the use of the file and the effect it has on the speed of the site.
All the HTML, CSS, and JS files on a web page increase the number of HTTP requests. One of the best solutions is to combine and minify these files.
This way, you will reduce HTTP requests in WordPress, but also the size of these files.
Combining means combining the multiple files into one.
For example, if a web page has 5 CS files and 5 Java files, then combining the CSS into one file and combining the Java into one means having two requests instead of 10.
According to Google tests, minification can reduce your page size with up to 63% compression savings.
Minification can be done quickly with the help of any popular WordPress caching plugin.
But there are WordPress plugins specifically for the minification.
- Fast Velocity Minify
- Merge + Minify + Refresh
- WP Super Minify
You can do it from your caching plugin, or use a separate plugin.
HTTP pipelining is a feature of HTTP 1.1, but it is not much in use due to the various problems it has.
However, the HTTP pipelining means sending the multiple HTTP requests on the same socket without waiting for the response. HTTP is a request -response-request cycle model. Until the browser receives a response for the previous request, it does not initiate a new request.
But with the HTTP pipeline, you can send multiple requests at the same time. It makes a significant change in the loading speed of the site.
Then again, there are issues. The web servers support the pipelining, but not the browsers.
Which means the page will load in the incorrect format. But still, HTTP pipelining is one of the ways to reduce HTTP requests in WordPress.
Using a CDN
By implementing a CDN on your site, you can further increase the speed of the website.
A CDN is a network of multiple networks, situated in various parts of the world. These servers create a cached copy of the static content and serve them from the CDN when the request is made again.
This saves the time taken by the server to receive and send a response. Moreover, the content is now served from the server located near to the user’s location. Hence cutting down the network latency due to the distance.
The shorter distance between the server and the user means the fast transmission of the data.
There are many CDN that you can use.
Popular CDNs are:
Final Tip: Check the HTTP/2
Sometimes you can do everything right, but get the fewest HTTP requests error in the website speed test.
In that case, check if the site is loading at HTTP 1 or HTTP/2. This is baffling that some hosting providers are still using outdated HTTP and PHP.
At ServerGuy, we keep our technological stack updated, so our customers can get the best of the best hosting experience.
HTTP/2 has many advantages over the HTTP/1. For one, HTTP/2 can load the files asynchronously. Do run your site URL in the KeyCDN test to determine whether your hosting supports HTTP/2 or not.
If not, then you should reevaluate your hosting company.
When you reduce HTTP requests in WordPress, it surely improves the site performance. But for the ideal speed, you have to get a better web hosting.
At ServerGuy, we guarantee a page load under three seconds. Do check out our WordPress hosting.
In this post, I mentioned a few best ways to reduce HTTP requests. I hope it helps you to increase the speed of your website.
If there is any problem or issue, leave it in the comment box.