# 增加不缓存index.html
        location = /index.html {
	       root   /usr/local/test-frontend/clientPlatform/dist; 
		  add_header Cache-Control "no-cache, no-store";
	   }
	    ```
	       root   /usr/local/test-frontend/clientPlatform/dist; 
	       这个设置 第一次忘记设置这个一直报错

html页面设置
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">

nginx 批量设置

location / {
            root   /usr/local/test-frontend/ez-platform;
            try_files $uri $uri/ /index_prod.html;
            index  index_prod.html index.html;
             # 增加不缓存index.html
             if ($request_filename ~* .*\.(?:htm|html)$)
	        {
	            add_header Cache-Control "no-cache, no-store";  #对html文件设置永远不缓存
	        }  
        }

Logo

前往低代码交流专区

更多推荐