+++
date="2020-10-16"
title="Nginx禁止html等缓存"
tags=["nginx"]
categories=["运维"]
+++

在本地开发的时候,经常会碰到缓存引起的莫名其妙的问题,最暴力的方式就是清掉浏览器的缓存,或者使用Ctrl + F5,Shift + F5强制刷新页面。 有时候按了好几下,缓存还是清不掉,只能暂时禁用浏览器静态资源缓存了,配置如下:

location ~.*\.(js|css|html|png|jpg)$
{
   add_header Cache-Control no-cache;
}   

相关文章:

  • 2021-10-03
  • 2021-10-06
  • 2021-09-14
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2021-07-03
猜你喜欢
  • 2021-12-06
  • 2021-11-30
  • 2022-02-06
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
相关资源
相似解决方案