我在nginx配置中有这些规则:
location ~* \.(js|css|png|jpg|jpeg|mp4|bmp|gif|ico|woff|ttf|svg|otf)$ {
expires max;
access_log off;
log_not_found off;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* /z.gif {
empty_gif;
etag off;
add_header Pragma no-cache;
add_header Cache-Control "private, no-cache, no-store, proxy-revalidate";
}
我不希望浏览器缓存z.gif。这种方法很好,直到以前的规则干扰后者。
如何让它们发挥作用?