Grow your CSS skills. Land your dream job.

Sprites & Requests

  • # December 11, 2009 at 8:46 am

    Hi

    I wonder if you guys can help me out here.

    What i would like to know is if spirtes always load even if an image from that sprite is not on the page ?

    As i have new template being built and on this page for example http://ip.slicedcreative.co.uk/review-simple.php what i would like to know is do these 2 sprites download when you open that page http://ip.slicedcreative.co.uk/images/s … thers2.png and http://ip.slicedcreative.co.uk/images/sprite-others.png ?

    As YSlow and Google Page Speed say those 2 sprites dont load up (which is what i want) however all the speed test tools like pingdom.com say those sprite do load on on that page http://tools.pingdom.com/default.asp?ur … id=1558364

    So who is telling the truth ?

    Just want to know, do sprites download even if that page doesnt have any of the images thats in a sprite ?

    # December 11, 2009 at 12:25 pm

    An image should never load unless it is being CALLED by that page. If it did, that means that a page would load every single file on a server, which would suck!

    The only thing I’m not sure about, is if it’s in the CSS.

    But to answer your question, the only files with "sprite" in the name that loaded for me were:

    sprite-icons.png
    sprite-master.png

    # December 11, 2009 at 1:28 pm

    thanks for the reply – yea i hope it is just those 2 spites that gets loaded by browsers.

    its just the pingdom tool throwing me off as it say it downloads the other 2 srpites i have – i guess its getting them from the css even though those srpite images arnt getting called.

    I just hope pingdom is wrong and we / yslow is correct.

    # December 11, 2009 at 5:57 pm

    yea….

    in theory, the image won’t load if it’s in your CSS file, but isn’t requested on your page. I would be very surprised if a modern browser automatically loaded every image in the CSS file, before checking the site code. You should be fine IMO.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".