Jitendra Vyas
Jitendra Vyas

Reputation: 152777

to reduce http requests which thing should be taken first?

I'm working on a website optimization where I need to improve the performance now so I used yslow and it suggested below things to improve to reduce http request.

Which problem should be solved first to improve performance suggested by yslow? or anyone can be taken because it will just save http request?

This page has 20 external Javascript scripts. Try combining them into one.
This page has 20 external stylesheets. Try combining them into one.
This page has 20 external background images. Try combining them with CSS sprites.

Upvotes: 1

Views: 1198

Answers (4)

AbuQauod
AbuQauod

Reputation: 919

Have you ever tried "lazy load".

+

Try to shrink CSS and JavaScrip files (combining them into one file.)

Upvotes: 0

Krease
Krease

Reputation: 16215

I'd recommend doing all three suggestions. As for which one to do first, it doesn't really matter, since it looks like each of them would be turning 20 requests into 1.

From the yslow documentation (emphasis mine):

80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages.

Now, if you're doing minification at the same time, then you can make the gains in your Javascript and CSS relative to the size of the content. For this reason, I'd recommend to start with either of these two, and do minification alongside file combining.

When code is minified all comments are removed, as well as unneeded white space characters (space, newline, and tab). In the case of JavaScript, this improves response time performance because the size of the downloaded file is reduced.

Upvotes: 2

Cerbrus
Cerbrus

Reputation: 72927

The external background images to sprites suggestion will probably be the most significant, since that's likely to be more data. Combining the JS / CSS files should both be roughly similar. I'd suggest using all 3 suggestions, though.

All 3 suggestions will reduce the HTTP requests by the same amount, though.

Upvotes: 2

scottlimmer
scottlimmer

Reputation: 2278

Doesn't matter, the aim is to reduce the number of individual requests.

Upvotes: -1

Related Questions