Closed serdargkaya closed 6 years ago
Btw it is good practice to creating folder for every image ?
Hey, I'm currently waiting for some feedback on the image name changes because I really only want to change this once if possible :)
Apart from this, 0.2.4 works fine. Upgrading to 0.3 will require rerunning manage.py process_imagefields --all
unfortunately, but that cannot be avoided when changing the file name generation.
Regarding folders: The idea is to avoid putting all images in the same folder, because (at least some) filesystems (in at least some configurations) on linux scan folders sequentially, meaning that if nginx serves a file, it has to scan through hundreds or thousands of entries to find the file which may become a performance problem.
https://stackoverflow.com/questions/13046714/optimal-number-of-files-per-directory-vs-number-of-directories-for-ext4 https://stackoverflow.com/questions/8238860/maximum-number-of-files-folders-on-linux
I'm working on a site with more than 100'000 images. The current fan-out of xx/xx/*
would create 16^4 = 65536 bins. Maybe that is a bit too much.
Maybe I could do what git does, and use a fan-out of xx/*
.
I should have checked first :) I already got some feedback, and released 0.3 with a small change to the filename hashing method.
@matthiask For seo it is good practice to keep image name. So this change needed to happen one way or another. I tested too looks good. Thanks.
Hi matt,
Can u release a pip package ? Before that let me test this changes if you haven't.