开发者

How to prevent specific images from being cached by browser with NGINX

I have an avatar upload page in my site. But when the user successfully uploaded the avatar the browser keeps showing the old one. How to prevent ava开发者_开发问答tar image from being cached by browser?


Haven't tried it myself but this might work:

if ($request_uri ~* "^/image/location.png$") {
  add_header Pragma "no-cache";
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜