Tenni over on the YUI Blog recently wrote part 1 on a piece about improving web performance by reducing HTTP Requests.
However, Tenni is taking a more focussed approach on just the HTTP Requests. Maybe part 2 will consider a more balanced and pragmatic approach like Cal has taken.
It’s all about balance
It’s clear that reducing requests will improve performance. It’s also clear that loading unnecessary resources decreases performance.
Some techniques I like to use
- Combine images
- Section/Semantic Specific Stylesheets
Distinct and independent sections should use distinct and independent resources.
For instance, styles and enhancements that are specific to the homepage of your site are likely only to be used on the homepage. So why not just keep them separated. Same goes for if you have a store section, documentation section, etc.
This isn’t to say you shouldn’t use a monolith when it’s necessary. However, be conscious of this.
For instance, you have a number of CSS sheets you are considering merging. Look at how often these sheets change. If 3 change often and the other 2 do not. Perhaps you should merge them into two; one for the more dynamic, the other for the more static. This way, you wont be recycling cache unnecessarily.
There is no doubt in my mind that one should still modularize your source, it’s simply much easier to maintain and make your work portable. It’s also clear you should modularize what you deliver and push down the pipe.
Again, it’s all about balance.