It looks like you're new here. If you want to get involved, click one of these buttons!
Amazing! Sign our contributors' agreement and then join us on GitHub.
Vanilla Forums Senior Developer [GitHub, Twitter, About.me]
ExpiresActive onExpiresDefault "access plus 1 year"Header set Cache-Control "max-age=15552000, public"
1. Directory structure is not optimal. If we have 5000 uploaded files, we'd get 5000 directories in /uploads/FIleUpload/. Some hosts don't like when user has too much files or directories in one directory. You might use something like this: sprintf('%02x/%02x/%02x', $id/10000, $id/100%100, $id%0x100). That would easily hold 16 millions of images with maximum 256 directories in each directory.
2. Urls are predictable. This is wrong when you want to restrict access to uploads for some roles. Say, you have subforum visible for moderators only. Now, if you upload something there you'd like not to let others see it. That's why other boards add something to path. say, time(), so that path looks like /uploads/1-1289639698.jpg. Random string would be even better.
I was trying to figure out how to block access to uploads/FileUpload/