Forum Moderators: not2easy

Message Too Old, No Replies

Do all CSS background image get loaded even if the CSS isn't applied?

         

smithaa02

5:14 pm on Jan 27, 2009 (gmt 0)

10+ Year Member



I'm worried about load times on my home page...

One of the things I was wondering was because my home page uses my default stylesheet, which in turn specifies a number of background image to elements not used on the homepage, do these get loaded anyways?

Or are the only CSS background image that get loaded are the ones that are directly used on that page?

rocknbil

6:45 pm on Jan 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a good Q, one I've always had on the back burner to answer. :-)

I experimented with this as follows. If you don't have FireFox Live HTTP Headers installed, install it.

Navigate to a page that's connected to the style sheet but doesn't use one of the bg. image or image selectors.

Clear your cache.

Open the live headers window, clear the headers pane, select the Generator tab, clear it also. Make sure "request" box is checked.

With the Live Headers window remaining open, refresh the page.

On my example, I have at least two background-image selectors not in use on this page, and I'm not seeing requests for them in either the Headers or the Generator pane.

Which tells me, the answer is no, but this may be browser specific or there may be holes in my test (which I hope someone will point out . . . )

smithaa02

7:10 pm on Jan 27, 2009 (gmt 0)

10+ Year Member



You know that's what I felt as well, but when I run one of those speed check sites ( [websiteoptimization.com...] ) they do count all these CSS images! So they're wrong then?

rocknbil

4:14 pm on Jan 31, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not ignoring the question, was hoping others might chime in here (or point us to previous posts on the matter we've missed . . . )