![]() |
PHP, Database, Server admin experts.. Got a question
When a tgp script crops and save thumbnail images, should it....
1. Save it all to one folder? Like this... www.domain.com/thumbs/imageid.jpg www.domain.com/thumbs/imageid.jpg www.domain.com/thumbs/imageid.jpg or 2. Save it into image id subfolders? Like this... www.domain.com/thumbs/imageid/1.jpg www.domain.com/thumbs/imageid/1.jpg www.domain.com/thumbs/imageid/1.jpg Which is better for output, PHP, database, and server performance? Or does it even make a difference? Thanks in advance! |
if you plan to have over 30,000 images you will want to do it option #2
|
If you have a lot of images, option #2 for sure, ideally even splitting it up so that for image123.jpg it's images/1/2/123.jpg or something similar.
If you have too many images (say, 1000 as a nice round number) per directory, you're going to start incurring performance hits. |
Quote:
|
At what point should it become a problem(in terms of 10k thumbs increments) if you have a script that does it option 1 style?
|
It's good to see that there are still technical, webmastery type threads here on GFY. I can't tell you how I much I learned here. Truly, I was and remain the noob.
|
you should start with the system you intend to use all along, IE option #2. If you go with option #1 eventually you're going to have to change the system, which is more work than you originally needed to do.
|
Thanks! I guess I am going to go with option #2.
|
Quote:
|
Quote:
not to mention querying a directory with 30,000 (or 10,000 even) files would take forever. |
Another good option is to use is date hashing, so if you want to clean things out, it's quite simple.
/YYYY/MM/DD/thumb... which makes the linking a little uglier, but it's a much better solution than /firstletterornumber/second/thumb - from the standpoint of if you want to clean things up and eventually remove them. |
Quote:
thumbs]$ ls -al|wc -l 6890 |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
folders are fine
|
Good thread, helped me with a recent problem on my tube script. Thanks guys. :)
|
Quote:
Quote:
Thanks again guys, gotta let my programmer know. |
The official answer from the staff at JMB, what do you think?
Quote:
|
| All times are GMT -7. The time now is 04:56 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123