Welcome to WebmasterWorld Guest from 23.20.147.6

Forum Moderators: ergophobe

Message Too Old, No Replies

Separating Images into Categories

organize imgs

     
9:25 pm on Jul 23, 2015 (gmt 0)

Junior Member from US 

joined:Dec 1, 2012
posts: 84
votes: 0


I'm thinking of having multiple image files for my ecommerce site so

http://www.example.com/dresses/images/
http://www.example.com/shoes/images/

I will not be reorganizing my old image file (that will stay as is), just changing set up for future product imgs.

Are there any downsides to separating my images in this way?

Thx - AC
9:46 pm on July 23, 2015 (gmt 0)

Senior Member from NL 

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

joined:Sept 25, 2005
posts:1427
votes: 178


Then you'll have images in two different locations, the old and the new. What's the benefit of your new set-up? Or: what's wrong with putting all images under /images/?
9:57 pm on July 23, 2015 (gmt 0)

Junior Member from US 

joined:Dec 1, 2012
posts: 84
votes: 0


I have a lot of imgs in my image file so I thought separating would help my url files load quicker. I mean, at what point does having all your images in one folder slow things down?
11:03 pm on July 23, 2015 (gmt 0)

Senior Member from NL 

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

joined:Sept 25, 2005
posts:1427
votes: 178


It depends on your filesystem and on whether or not you access the folder, e.g. via FTP. If you're talking thousands of images and you have a way to logically divide them into subdirectories, then that would probably be a good idea, but it would make more hierarchical sens eto me to then stick them in /images/subdirectory/ rather than /subdirectory/images/.

One option for naming subdirectories is by alphabet (or numerically), e.g. redwidget.png goes into /images/r/, or even /images/r/e/ if you're talking tens of thousands of images. That may be more foolproof than choosing categories such as /images/shoes/ since those names are more likely to change in time.

Overall I wouldn't expect load times to improve, but it's good to think about the effects of future growth.
11:50 pm on July 23, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:7511
votes: 505


In most cases you won't see much of a speed increase as all files are being served from the same host. To achieve a faster time look into a CDN arrangement where these static files are served from edge locations an not the host server.

And you need to be talking about more than 50,000 images, for this to make much difference.

As these are product images, look to which are static (dn't change for the product year in year out) and what's "new" and does not stay for long periods of time. Keeping track of these images can be a monster if your name/tag system is not 100%.

Some of my clients never clear their discontinued or no longer needed images and that merely creates a storage overhead (and additional costs as boundaries are exceeded). then again, we're not talking about taking out a bank loan, but it is additional costs not necessary.

Divide your images into folders that make sense to you. Your pages don't care, nor do your users.
12:29 am on July 24, 2015 (gmt 0)

Senior Member from FR 

WebmasterWorld Senior Member leosghost is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Feb 15, 2004
posts:6717
votes: 230


I too was going to ask "why"..Then saw that robzilla and tangor had replied to you while I was busy elsewhere..:)
Images /subdirectory/subsubdirectory/ etc is the simple and foolproof way to organise images..and isn't going to "slow your pages down"..

Don't over nest them..I've seen some sites ( particularly WP ) where people nest images in folders that go ten levels or more down..and using non descriptive folder names..and non descriptive file names , just numbers! How they ever find things again to update or change..

Just one thing that I can think of to watch for..if you are doing your "dev work" on windows, look out for maximum length filepath or whatever win calls it nowadays..if it gets too long ( can happen ) win won't let you move certain files to certain places because the file path is too long..When that happens in a move of thousands ( or even hundreds ) of files, it can be a real time suck renaming things / fixing it..
12:55 am on July 24, 2015 (gmt 0)

Junior Member from US 

joined:Dec 1, 2012
posts: 84
votes: 0


Ok, glad I asked for opinions. It seems I don't need to worry about keeping lots of images in same file but if I do subcat I should do so inside of original image file. I didn't think about shortening the name of subcats to just a letter or 2 which would actually work very well for me.

I've been told to never delete old sold product files which means the images would have to be there also and this would really add up after a few years. I sell vintage and antique textiles requiring around 5-6 photos per product most times for people to know what they are really getting. This will add up through the years.

Thank you for all your thoughts and suggestions. These will help if I do decide to change things up. For now it seems I don't need to worry re too many images in same file.
12:59 am on July 24, 2015 (gmt 0)

Junior Member from US 

joined:Dec 1, 2012
posts: 84
votes: 0


And yes, I have learned about win's dislike of long file names. Another thing to keep in mind when naming subfolders if and when I do this.
3:15 pm on July 24, 2015 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8471
votes: 222


There's an implicit question in robzilla's post that would be helpful to answer: what filesystem are you using?

If you're using ext3, do you have dir_index active?

Those factors can make a big difference. With ext3 and dir_index, 50,000 files will likely be no problem. Without it, you may see performance issues at much lower numbers.

That said, when thinking performance, you need to profile your app and look for big wins. I would guess the difference between 100 files in a directory and 100,000 files in a directory will be a couple of milliseconds on your page load. One bad SQL query might be 2000 milliseconds. One tracking script that uses blocking Javascript might be 5000 milliseconds or simply result in the page failing to load. I recently took over a site where third-party blocking scripts can result in 10 second delays! No amount of rearranging image files on the hard drive are going to compensate for that.

As tangor said - if it makes sense to you and is easier to divide them into logical buckets, by all means do so. But if you are doing it for user experience or page load optimization, don't bother, especially if this makes *more* work for you - in that case, spend your time on optimizations that will have a much bigger impact.

In brief: profile first. Optimize second.
6:51 pm on Aug 2, 2015 (gmt 0)

Junior Member from US 

joined:Dec 1, 2012
posts: 84
votes: 0


Thank you for your detailed response, ergophobe.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members