php - Is it ok to have a large number of directories on a web server? -


i developing website users can upload items,products ..

each items can have 6 images .. did made directories each members (using id folder name).. , sub directories under own folder (using item id sub folder name) ..

ex. '/uploads/1/items/1/item-pic.jpg' - 1-member_id, , other 1-item_id

what want know ok have many directories in server, because can see, if have reached thousands of members, have thousands of directories .. affect performance/accuracy??

it's ok, although single directory thousands of entries can cause performance problems. can split them based ona prefix, such as:

/uploads/1/10101 /uploads/1/10203 ... /uploads/2/2000 /uploads/2/20199 ... 

this uses first character of user id first level of subdirectory.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -