如何防止浏览器使用NGINX缓存特定图像

时间:2011-09-25 06:41:03

标签: browser nginx

我的网站上有一个头像上传页面。但是当用户成功上传头像时,浏览器会继续显示旧头像。如何防止浏览器缓存头像图像?

1 个答案:

答案 0 :(得分:0)

我自己没试过,但这可能有用:

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