开发者

Publish new image to the website, but need to F5 to show the new effect [duplicate]

This question already has answers here: Disable cache for some images (13 answers) Closed 2 years ago.

Everytime I update new image like 'index.gif' to website without changing image's name, the user could not see the update until they fresh the b开发者_开发技巧rowser by F5 to clean the image cache.

It is same as updating css, but I usually change css link version like:

<link href="index.css?ver=xxxxxx" rel="stylesheet" type="text/css" />

Because there is only one reference to this css, so I can change it easily. In contrast, there are so many refers to one image, so I'm frustrated for changing all the links to new image.

So is there any easy way to solve my problem?


You can do the same thing with image files that you're doing with your css. Have you tried that?

Another option, which I don't recommend, is telling your web server to stop sending cache headers with image files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜