开发者

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

开发者 https://www.devze.com 2023-04-08 10:02 出处:网络
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 brows

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

精彩评论

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