سؤال

I'm trying to optimize the loading time of my website. Does requesting the same image in different places of the code increase load time? For example, I'm using an image as background of a button and I'm loading the same image in different places of the website. Is this a problem or since the file is the same in all the buttons the browser only loads it once? If it's a problem, how can I optimize it? Thanks a lot!

هل كانت مفيدة؟

المحلول

no, repeating the same image multiple times should load it only once. You could even go further and actually use css sprites to have multiple images in one (one image which is a grid of images as a background within a smaller containing div and move it around with background position property)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top