性能:文件丢失、文件存在、htaccess
我有一个提供缩略图的页面,有时会丢失一个。我本来打算在缩略图循环内的代码中添加一个 file_exists()
,但后来认为这个额外的函数在处理数百个图像时可能会大大减慢速度。在这种情况下处理损坏图像的最佳做法是什么?也许这应该在 htaccess 文件中完成?
理想情况下,任何未找到的图像都应返回 Missing.jpg
提前致谢!
I have a page that serves up thumbnails and occasionally one goes missing. I was about to add a file_exists()
into the code within the thumbnail loop but then thought that this extra function might slow things down considerably when done on several hundred images. What is the best practice for dealing with broken images in this situation? Perhaps this should be done within the htaccess file?
Ideally any images that aren't found should return a missing.jpg
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论