How to make fewer HTTP requests.
Check how many HTTP requests your URL makes
You can use the HTTP requests checker below or the page speed test to see how many requests your web pages make. You can also see which type of requests your web pages make (images, css files, etc..):
When your web pages make too many HTTP requests you should minimize the amount of supportive files your web page loads by replacing and removing as much of them as possible. Learn how to do that below:
Combine & inline your CSS scripts
Most website templates require multiple CSS files (usually in the header and the footer) to load to support the template. You should combine these files to one large file to minimize the amount of HTTP requests. It’s as simple as opening all the files and copy & pasting their content to one file. Make sure that file paths inside the CSS scripts are correct. An even better option is not using a file for CSS at all but inlining the CSS script for the above-the-fold content in the HTML head and defer loading the rest of the CSS instead, read more about that here.
Minimize the use of design & functional images
You should aim to minimize the amount of images used for design or functional reasons and load only those you really can’t miss. Lots of older, or badly coded designs use images for backgrounds, buttons, borders, hover effects or other design purposes instead of CSS. The same visual effects can usually be achieved by using small CSS scripts which will reduce the number of HTTP requests. A good free online tool to create various visual CSS effects is CSS3.0 Maker.
CSS image sprites
When you really can't escape using images for your design you can combine and save all of those individual images to one bigger file by using CSS sprites. You can then call the individual images from a CSS script by using X and Y coordinates. This way the browser only has to make one HTTP request for multiple images. You can use the CSS Sprites Generator tool to create these CSS sprites. Read the documentation on how to use the sprites on your website.
Convert images to Base64 code
You can encode your functional images (like your logo) to a Base64 string, which basically means you transform an image file into script code. One you have the code you replace the original image tag with this code to display your image. This way your web pages make fewer HTTP requests. You can use the Base64 File Encoder tool for this. Just select the image of your choice and your Base64 image code will be generated automatically.
Minimize amount of plugins
Plugins can be a great asset to a website but usually require several web files to load on your web pages to function. This is why it is important to really only use plugins when you deem it absolutely necessary.
Limit the amount of social buttons
Content Delivery Network
A Content Delivery Network (CDN) makes it possible to serve your web files from different (sub)domains. This reduces the number of HTTP request your domain has to process. CDN services also usually provide a network of servers accross different locations all over the world. This makes it possible to deliver your files to your visitors with the smallest response time (first byte time) possible.
Is your web page still making too many HTTP requests?
When your website still makes too many HTTP requests from the same domain (20+ and above) you should create a subdomain and place some of your files on this subdomain. Subdomains are seen as seperate domains by browsers. Because of this you can load a higher number of files at the same time which will speed up your website. Don’t overdo it though, you should never use more as 2 subdomains to serve files as overdoing it will actually slow down your website because of too many parallel connections.