dongxia026531 2010-09-29 13:45
浏览 68
已采纳

php图像保存/调整大小/显示实践

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:

  1. Upload and automatically create all sizes needed
  2. Upload a single size image then call a single script which based on a parameters resizes/crops and displays image directly to user
  3. Upload a single then also with script generate new and cache it for further use (this would require use of file_exists() to check if generated version exists)
  4. Call image directly then if it doesn't exist redirect with htaccess to script which would generate it
  • 写回答

2条回答 默认 最新

  • douxun1934 2010-09-29 13:55
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大