I have a product list with hundreds of products, and thousands of images (around 2,500), and the list is growing. I had all the images in one folder, numbered 1.jpg to 2500.jpg. When I open the folder in any FTP client it only shows me 1998 files (I guess the max) so I have to delete files to see more. I imagine this is really slow for the server. Would it be better to break them down into sub folders?
Like this:
/products/1/1.jpg - 1000.jpg
and
/products/2/1001.jpg - 2000.jpg
I'm looking for the fastest/best option for server load. I need to pull these images often on my site, but not all at the same time (obviously). Anyone know the best solution?
Files or folders?
Moderator: General Moderators
-
jabbaonthedais
- Forum Contributor
- Posts: 127
- Joined: Wed Aug 18, 2004 12:08 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
As long as the server isn't pulling a list, I have yet to see one slow because of a few nested folders. As an example, I have multiple levels (I think four) of folders in one thing I've built. So they're all separated out, nice and tidy. It works without any issue.
Consider this: internally reference them as say 01234567.jpg. You could store that file at /01/23/45/67.jpg or /01/23/45/01234567.jpg.
Consider this: internally reference them as say 01234567.jpg. You could store that file at /01/23/45/67.jpg or /01/23/45/01234567.jpg.
-
jabbaonthedais
- Forum Contributor
- Posts: 127
- Joined: Wed Aug 18, 2004 12:08 pm
Normally I don't have to FTP to them. In fact, I had it setup this way for 6 months. The only time I ran into a problem was when I changed to a new server and had to backup everything and upload to the new server. I had to delete 1,000 files, download 1,000, delete and repeat until I had them all.Grim... wrote:Do you really have to FTP to them?
As long as the server isn't called to display all the files at once (which it is when you FTP to it) the server doesn't care how many files are in one folder.