Home  >  Article  >  Backend Development  >  关于图片缓存的问题

关于图片缓存的问题

WBOY
WBOYOriginal
2016-06-23 14:10:50904browse

网站用的是thinkphp开发,isapi_rewrite3重定向URL,IIS6服务器

但是
1.IIS启动内容过期
2.php设置header()
3.html加入
都无法让浏览器缓存图片,到底是什么原因


怎样才能做到,即使浏览器F5刷新也不会清除图片缓存?
比如这个网址http://nanning.xjwy.cn/bao/img_show.php?imgurl=http://nanning.xjwy.cn/upload_files/qb_bao_/1/87829_20130516110511_7bwar.jpg&baoban=

只加载一次图片,后面刷新都不会清除图片。


回复讨论(解决方案)

来个人回答啊

http://nanning.xjwy.cn/bao/img_show.php 返回的页面中有
关于图片缓存的问题
这样的图片当然就会被缓存啦

img_show.php中加入缓存命令,如:
header('Cache-Control: max-age=31536000'); //数字是你想缓存的秒数
echo file_get_contents($imgurl);
?>

img_show.php中加入缓存命令,如:
header('Cache-Control: max-age=31536000'); //数字是你想缓存的秒数
echo file_get_contents($imgurl);
?>
没有用.............
我改成直接引用图片就可以达到F5刷新不要重复加载图片。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn