Forum Moderators: open

Message Too Old, No Replies

Files directory

image folders in each dir.

         

Birdman

12:29 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello WW. I was told to have a copy images in each directory they will be used. Is this true? My site will eventually have many directories and it seems that I would be wasting alot of space with layout graphics. Does it make a difference if some images are stored in different directories?

Birdman

The Contractor

12:36 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Birdman,

Might make it easier to keep track of all the images but that is the only advantage I know of. I name the images so they make sense and have not had a problem with keeping them in a single directory.

My 2-cents

Nick_W

12:45 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I generally have one /images dir and then:

/images/this_section/
/images/that_section/

Presuming there are enough images for it matter of course.

Nick

Birdman

1:04 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you both for your quick replies. I am getting ready to start adding many pages to my site and want to be sure I get it right the first time. Of course I'll probably find something wrong after I have a hundred pages or so, anyway. ;)

Nick_W

1:27 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hehe, good luck! I'd put money on you not getting it write first time though. I've been doing this a little while and I learn new stuff and get better at it on an almost daily basis.

My guess is your first go will last a grand total of about 2-3wks before you start redoing it ;)

Nick

korkus2000

1:38 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use absolute paths to my images folder. I put my image folder on the root. Then every directory uses www.example.com/images/imagename.gif

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.

buckworks

2:26 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Something to keep in mind if you have pictures that are used on more than one page in your site: if you always link to the same copy of the picture, named exactly the same way, your visitor's browser will (usually) recognize that it has seen that file before. After a picture has downloaded once, when it comes up again on a different page the browser can reload it from cache, almost instantly. Faster page loads are always A Good Thing.

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.

Birdman

4:58 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks korkus2000 and buckworth.
Both of your points are very good. I switched everything back to root image folder.

Nick_w
Unfortunately, I know what you mean. My first site is on it's third version and now I can't stand it either. :(

Thanx everyone, Birdman :)

pageoneresults

7:38 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've done it both ways, stuff them all into one images directory and then also break them up into sub-directories.

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.

pageoneresults

7:50 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The Contractor brings up a good point with this...

> 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!

dcheney

8:04 pm on Jun 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tend to store my images off the root with subdirectories for images used only once. I often use html like this:
<img src="../images/myimage.gif">

I have not seen any problems with using that style, but am I setting myself up for trouble?

Birdman

3:02 pm on Jun 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks pageoneresults.
>>I keep all core navigation images in the root/images directory with >>absolute paths being used for those images.

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!!! :)

Nick_W

3:05 pm on Jun 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But you don't have to use absolute urls. I can't think of any benefit from that at all? Use urls [/b]relative[/b] to the root dir like

/images/widget.gif

You can call it that way from anywhere on the site at all as the begining '/' means it's relative to the root dir.

Nick

brotherhood of LAN

3:05 pm on Jun 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In future I will probably store images in a folder with a one character name, and have all other folders 1 level deep. Then I can call each image from a db :)

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 :)

Eric_Jarvis

3:56 pm on Jun 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



some good points so far

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

Birdman

4:05 pm on Jun 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nick_W:
But you don't have to use absolute urls. I can't think of any benefit from that at all?

I thought I had read somewhere that google needs absolute urls for their cached version of a page.

pleeker

12:47 am on Jun 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe images load faster when they are located in the same directory as the page on which they're called -- something about the web browser not needing to open up a separate directory on the server and locate the image inside it. I'm sure it's not an incredibly noticeable speed difference, but if you have a lot of images it might make a difference. If I have a subdirectory for the ABOUT US page, for example, and that page has a staff photo which only appears on this page, then I put the image in the same directory as the page where it appears (probably /about/).

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....)

The Contractor

12:49 am on Jun 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Birdman,

<<I thought I had read somewhere that google needs absolute urls for their cached version of a page.>>

Not true.

Goes to the old saying "Don't believe everything you read". ;)

pageoneresults

1:17 am on Jun 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



> But you don't have to use absolute urls. I can't think of any benefit from that at all?

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!