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 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集