Is the browser caching CSS background images?

When I have the same image used for different elements (sprite images), I usually do not call this image again, as this is a new HTTP request.

I rather use:

element1 {
    background: url(someImage.png);
}

element2 {
    background-image: inherit;
}

Are these HTTP requests saved?

Or if the browser is smart and I can use:

element1 {
    background: url(someImage.png);
}

element2 {
    background: url(someImage.png);
}

Will the browser make a new HTTP request? Or does he know that I have already uploaded this image?

Question: am I getting something using example 1?

+5
source share
3 answers

In the scenario you describe, the browser will essentially link to the same image several times on the same page, and this will almost certainly be cached.

, , , .

+5

, CSS . Firebug, HTTP-, .

+4

, appcache.appcache . appcache. HTTP-, , .

!

+1

All Articles