清除一张图片的缓存 [英] clear cache of one image

查看:65
本文介绍了清除一张图片的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑最小的示例:使用php我有一个输入文本的表单,它生成文本图像。然后,当我更改文本并进行更新时,我看不到新图像,因为我认为它已经被缓存了。当我更新它时,是否有某种方法可以自动从缓存中删除该图像文件?

Consider the minimal example: Using php I have a form that you enter text and it produces an image of the text. When I then change the text and update, I don't see the new image because I assume, it is being cached. Is there some way to automatically remove this one image file from the cache when I update it?

推荐答案

这通常通过添加查询的随机字符串或时间戳。

This is frequently handled by adding a random string or timestamp to the query.

ie < img src = / images / image.jpg?timestamp = 1357571065 />

这篇关于清除一张图片的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆