Website loading speed depends upon many factors, one of which is number of HTTP requests. A basic web page consists of different objects including images, videos, flash files, advertisements, CSS, JS. When your browser requests these objects from the server, it makes HTTP requests. These HTTP requests reduces the page loading speed and cause poor user experience. Fast loading websites are also ranked better in search results as seen in recent Google algorithm update. More the requests, less is the page loading speed. HTTP requests in WordPress can be reduced by following some safe methods.
Why to Reduce the Number of HTTP Requests
How to Reduce HTTP Requests in WordPress
There are three easy ways you can reduce HTTP requests:
- Combine the CSS files
- Reduce the number of images
Get W3 Total Cache plugin for wordpress, go to minify page and enable JS minify settings as shown below.
How to Combine CSS in WordPress
Go to minify page in W3 Total Cache plugin, scroll down a bit and look for CSS section and enable CSS minify settings. Find the CSS files by looking into source code of your homepage. After finding all the CSS files you want to combine, go to minify page in W3 Total Cache plugin. In CSS section click on Add a style sheet and add all the CSS files one by one.
Save all the settings and empty all cache.
How to Reduce the Number of Images
Each image on a web page counts as one HTTP request, reducing the number of images on a page is helpful in reducing the requests. Image requests can be reduced by removing useless images and by using CSS sprites.
Use CSS Sprites
CSS sprites combine the images of a page into one single image, resulting in less HTTP requests. For example, there are 15 images on a page, so those images will count as 15 HTTP requests, while when you use CSS sprites, it will count as 1 HTTP requests. So, if you have lots of images on your homepage, use of CSS sprites is recommended.
Some online sites where you can create CSS sprites easily: CSS sprites generator
How to Add Scripts to Header and Footer
Instead of using external js file for small scripts, they can be included in header or footer of the web page. For example, tracking codes can be included in footer just before the </body> tag.
These were some of the easy and free ways to reduce HTTP requests in wordpress, which can have a huge impact on your website speed. You can also try some Free CDN to speed up your site. If you think I missed any point or you would like to add anything to the article, feel free to comment below.