Will browser download image twice if it's used in both an image's src as well as a div's background-image?

前端 未结 3 394
粉色の甜心
粉色の甜心 2020-12-24 11:47

Due to reasons that are necessary but difficult to explain here I am setting both an absolutely positioned image as well as a background image on a div.

I want to ma

3条回答
  •  情话喂你
    2020-12-24 12:40

    No, it will download it once and then be placed in the browser cache. The next time that URL is referenced it will look up the image from the cache rather than retrieving it from the server.

提交回复
热议问题