liujiusheng / blog

个人博客,blog
19 stars 0 forks source link

Nginx 不缓存index.html #163

Open liujiusheng opened 4 years ago

liujiusheng commented 4 years ago

location ~ .*.(htm|html)?$ { add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; access_log on; }

要特别注意前面location这里的正则,因为有时候部署的时候前端请求首次请求的不一定是html文件,这需要根据实际情况进行调整。