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";
}
精彩评论