Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question
    
"Can I increase..." - Presumably you should be asking: "Can I decrease..." ?! –  w3d Jun 10 '13 at 19:51
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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