: Comfortable number of server files in a folder I'm building a website which holds its images in relevant folder, but I was wondering how to structure the folder paths ( month/year/ or just
I'm building a website which holds its images in relevant folder, but I was wondering how to structure the folder paths ( month/year/ or just year/ )
I will be getting the images via php, so the scripting will look like:
files/cover_photo/$year/$month/$id.jpg
I don't really know how many images I'm going to be posting but was wondering how many images is a comfortable number in each folder if they are going to be selected using the PHP script above.
I don't want to risk slowing my site down by having too many images per directory, but at the same time I don't want to have too many directories with few files inside.
Can anyone give me any advice?
More posts by @Murray432
1 Comments
Sorted by latest first Latest Oldest Best
There is not really a "right answer" to this.
Sorting by year/month is not a bad option, because it's easy to implement and it scales well.
There's no need to worry about empty directories though - just create the directories when you need them (i.e. the first time there's an upload in that year or month).
This is the way Wordpress does it.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.