5

I've created a website that has multiple pages, and each page has it's own dedicated folder. Inside of each page's folder I've created a dedicated image folder.

I reuse many of the same images (logos, buttons, etc) across the site, but I always link from the current pages dedicated image folder.

Would my images load faster if there was only one image folder (placed in the root folder), and each page used that as the source of its image files? Will this cache the images?

1
  • "Can I increase..." - Presumably you should be asking: "Can I decrease..." ?!
    – MrWhite
    Jun 10, 2013 at 19:51

1 Answer 1

5

I reuse many of the same images (logos, buttons, etc) across the site, but I always link from the current pages dedicated image folder.

If the images are in different folders (ie. duplicated) then these are different images and the browser is going to load each separately and not use the cache.

/subdir-1/img/my-great-picture.jpg
/subdir-2/img/my-great-picture.jpg

These two images have different URLs and are therefore seen as different images (even though they might in fact be the same image).

Would my images load faster if there was only 1 image folder (placed in the root folder), and each page used that as the source of its image files? Will this cach the images?

Yes - this is what you need to do. All common images should be in 1 common directory that all pages can access. ... from 1 common stylesheet.

For small decorative images you should also look into CSS sprites.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.