Forum Moderators: open
If you put your image folder in every directory it can get very confusing and waste server space. I also hear that absolute img src also helps google image for image searches.
On the other hand, if you have multiple copies of the same picture in different places on your site, and sometimes link to one, sometimes to another, the picture will seem the same to the visitor but not to the browser. Instead of reloading from cache, the browser thinks it needs to fetch a completely different picture, and will download the image from scratch, however long that takes. This will eat unnecessary bandwidth, and also slow down the user's experience.
Keeping your images in one or two centralized places on your site avoids both these problems.
I find that working with larger sites, sub-directories with their own image folders make it much easier to manage.
Typically, if you have a sub, then all content relative to those pages should be within the sub. Ever try scrolling through thousands of images in one directory? It gets a little frustrating at times but it works if you know what image names you are looking for. That is where the naming conventions come into play.
I feel a logical structure is to place all content relative to a specific topic into its own sub-directory. Something like this...
root/
root/sub-1/images
root/sub-2/images
root/sub-3/images
root/sub-1/sub-1a/images
root/sub-2/sub-2a/images
root/sub-3/sub-3a/images
Usually when you have a structure similar to above where each sub-directory is targeting a specific topic, then it may help with manageability to place all appropriate files within their topic.
I keep all core navigation images in the root/images directory with absolute paths being used for those images.
> I name the images so they make sense and have not had a problem with keeping them in a single directory.
Naming the images so they make sense, but at the same time naming them so they are relative. If you have a picture of a Blue Widget, you might name it blue-widget.gif. Or, if the targeted term is widgets in general, you might name it widgets-blue.gif.
Since we are talking about directory structure here, you should also apply this same theory to your directory names and individual file names. Do it now before the indexing occurs, you'll be a much happier camper!
That is the perfect answer to my question. I really didn't like the idea of copying the main layout graphics to all those sub-directoties.
>>Ever try scrolling through thousands of images in one directory?
I will now try to organize images into separate dirs off root image folder.
Thanks everyone!!! :)
If files from the image folder were referenced 10,000 times a day, and I cut my folder name by nine characters...then everything will be that little bit smaller and faster :)
I always use a single version of each image...but I have up to three image directories just off the root
furniture...which contains graphics that are used on every page as part of the layout
graphics...for other graphics that are used on many pages
images...for the one off single instance graphics
I'd split the images directory for a large graphics intensive site
However ... I also leave any and all common images right in the root directory of my sites. All of the menu buttons, for example, which are used across the site stay in the root directory, this way they only have to be loaded once and not every time a user goes to a new page. (The caching issue that was mentioned earlier by buckworks is spot on....)
I've been using absolute URL's for main linking structures as long as I can remember. I'm glad that I have been too! I've found out some very interesting information recently concerning relative paths and DNS. If someone wants to be unkind to you, they can wreak havoc on your site through DNS using the relative URL's.
For all of my includes, absolute URL's are mandatory. It just makes it so much easier for me to copy and drag them around the directories. I'm also told that it provides for quicker load times as the browser has direct paths to information as opposed to that millisecond of delay marrying the http to the relative path.
Yes I know, code bloat. All those absolute URL's do add to the size. But after finding out about the DNS issue, I'll take the extra html bloat and be happy that I did!