I'm having a debate with a fellow programmer (PHP) and we both disagree when it comes to GUIDs. Assuming that information about each image is being stored in a DB and has its own primary key (int).
What reasons could there be for using a unique ID for the image filename, beyond not having to worry about duplicate filenames?
I don't want to disregard his methodology, but it doesn't sit well with me either.
Thanks! Ben
Update: Having heard many +1's for GUIDs, how might SEO be affected by "randomly" generated image filenames? (Thanks Sukumar)
What reasons could there be for using a unique ID for the image filename, beyond not having to worry about duplicate filenames?
Using an auto-increment primary key for a file name would make it possible to guess other images' URL's, which may be something you do not want - depending on how your system works, users could, for example, gain access to images that aren't intended for publication (yet).
I think using unique IDs is quite a good idea.
Summary: It is a trade-off you need to consider based on your requirements. More preference seems to be given to choosing GUIDs though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With