To avoid missing pictures on my site, and show a 'missing picture' image instead, I have been running a periodic file_exists check, and updating a flag in the database to show whether the picture exists or not.
But now I can't see any reason not to use file_exists on the fly. How fast is it? Would it slow down page load?
btw there's maybe 50,000 files in the image folder, if that makes any difference.
Detecting missing pictures
Moderator: General Moderators
-
hessodreamy
- Forum Commoner
- Posts: 58
- Joined: Wed Apr 20, 2005 8:11 am
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
try it, find out.
As for having that many files in a single folder... generally not the best of ideas as many file systems don't like having multiple thousands of files in a single directory. They often won't deny you to do it, but performance in that directory will often degrade as more files are added. I'd suggest breaking the directory up into multiple directories.
As for having that many files in a single folder... generally not the best of ideas as many file systems don't like having multiple thousands of files in a single directory. They often won't deny you to do it, but performance in that directory will often degrade as more files are added. I'd suggest breaking the directory up into multiple directories.
-
hessodreamy
- Forum Commoner
- Posts: 58
- Joined: Wed Apr 20, 2005 8:11 am
hmmm... separating the files had occurred to me, but more for my own benefit rather than server performance. But yeah I do think that would be a good idea.
As for the original problem, if the difference isn't going to be significant, I think I'll go with checking them on the fly, just because the code, and the updating processes would be simpler.
As for the original problem, if the difference isn't going to be significant, I think I'll go with checking them on the fly, just because the code, and the updating processes would be simpler.
Re: Detecting missing pictures
bokehman:
hessodreamy wrote:To avoid missing pictures on my site