Search code examples
optimizationyslowhttp-request

YSlow recommendations. How necessary are they?


So I've just downloaded yslow for firebug and have taken a look at the results for a site I am building.

I'm seeing recommendations, for example, to use ETags, cookie-free domain for my static components, and add expires headers.

I'm thinking, well I could go off and fix these but there's more likely a bunch of other optimizations I could do first, e.g caching results from database calls or something similar.

I don't think this site will get 'that much' usage to warrant YSlow's recommendations.

I know that you should never optimize before you know you need to, but I'm thinking things like ETags and expires headers surely only come into play on sites with really heavy traffic.

If for example, I've written a poor implementation that makes 5 (relatively small) calls to the database per request, and YSlow is telling me that my 14 images are not on a cookie-free domain, then which of those two optimisations should be tackled first?


Solution

  • YSlow is good to check the "User Experience" that you users are seeing. Its recommendations are to help make the page appear to load quicker. E.g. 14 images to 1 image and spriting is purely a visual thing. The rule is because browsers can only download a few images in parallel at any one time.

    I would always tackle backend optimizations first as they can help you towards making your site scalable, if it ever gets that big.