How to Reduce the Number of HTTP Requests of Your WordPress Blog
One of the biggest factors of site performance is the number of HTTP requests that your pages are making to the server. Each request for a CSS file, JavaScript file, image, or any other external file requires a separate call to the server, which then must acknowledge, process, and return the requested file. When you have too many files linked to a document, either in the <head> area or in the content itself, Your site’s performance may be negatively affected. This effect is easily seen by comparing the load times of sites that include many different CSS and JavaScript files with sites that have taken appropriate measures to reduce the overall number of requests made by their pages. Here are a few tips for reducing the number of HTTP requests made by your site.
• Eliminate unnecessary files - Anything that you are calling from your web page that is not absolutely essential should be cut out from the picture. When possible, replace design-related images such as rounded borders with pure CSS alternatives.
• Consolidate CSS files - Instead of linking to five different CSS files, combine them into a single, optimized file. If you’re not sure, check your source code – you may be surprised to find that some of your plugins are calling additional CSS files.
• Consolidate your JavaScript files – As with your CSS files, combine multiple JavaScript files into a single, optimized file. Check your source code and consolidate anything that you can get your hands on. Just make sure to preserve the order of appearance of the various scripts.
• Use image sprites - If your theme design makes heavy use of images, the number of HTTP requests may be very high indeed. Check your design and look at the images being used. If any of them can be combined into a single image, then try to do so. Granted, combining images into so-called “sprites” is a bit of a dark art, but with a little research and some practice, you will find the reward of improved performance to be well worth the effort. A great example of image sprites is seen with social-media icons that have been combined into a single file and then positioned differently for each link with a little CSS. This one technique can drastically cut down on requests and help speed things up.




