【问题标题】:How to clear browser cache using angular 7 in production如何在生产中使用 Angular 7 清除浏览器缓存
【发布时间】:2020-08-21 15:19:15
【问题描述】:

在我的项目中,我使用的是 .net core 和 angular 7。每次部署后我都需要清除浏览器缓存。 ng build --prod --output-hashing=all,对我不起作用。请帮忙。

【问题讨论】:

    标签: angular caching


    【解决方案1】:

    只需在 web.config 文件中添加以下标签

    <configuration>
      <system.webServer>
        <staticContent>      
          <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="0.00:01:00"/>//1 minutes
        </staticContent>
      </system.webServer>
    </configuration>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-06
      • 1970-01-01
      • 2010-11-05
      • 2013-07-17
      • 2011-10-23
      • 2021-05-30
      • 1970-01-01
      相关资源
      最近更新 更多