html不进行缓存,将js和css文件进行缓存配置

 

   location ^~ /abc {
         if ($request_filename ~* .*\.(?:htm|html)$)
         {
             add_header Cache-Control no-store;
         }
         if ($request_filename ~* .*\.(js|css|jpg|jpeg|gif|png|ico)$)
         {
             add_header Cache-Control max-age=2592000,s-maxage=68400;
         }
         alias /data/www/abc/dist/;
         index index.html index.htm;
         try_files $uri $uri/ /index.html;
    }

 

相关文章:

  • 2022-01-13
  • 2022-01-13
  • 2021-12-15
  • 2021-06-02
  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
  • 2021-06-05
猜你喜欢
  • 2022-02-15
  • 2022-01-10
  • 2021-05-17
  • 2021-04-06
  • 2021-10-16
相关资源
相似解决方案