且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何防止浏览器缓存图像?

更新时间:2022-11-18 10:13:02

另一种替代方法是在图像文件后添加一个随机字符串。

Another alternative would be to add a random string after your image file.

<img src="/path/to/image/image.jpg?<?php echo time(); ?>/>

这应该确保每次页面显示时重新加载图片。

This should ensure that the image is reloaded each time the page is displayed.