Reputation: 3081
What are the best practices on image handling on a php driven web site when several versions of the same image are required (different sizes), bear in mind it's a high load website:
Upvotes: 2
Views: 418
Reputation: 16616
If your images is something like avatar or gallery image and he in many cases was be viewed by other peoples or by the people who uploading image, use option #1
, this is very good way because time to generate image you can assign to upload time, then if this algorithm was be errored will be reasonable submitted to user.
But if your uploaded images can never was be viewed think about option #3
, this case is not good in overall because some images may be corrupted and you know this in generation time while you must show image. I will be don't use this solution.
Upvotes: 1
Reputation: 10880
If its a high traffic website, i would suggest you go with #1. Also keep in mind that if this is a high traffic website, you might need to move to a CDN soon, in that case it would be ideal to generate all thumbs and upload to your CDN and load in the page with a cookie-free domain.
Upvotes: 3