【问题标题】:Clear browser Cache after deploying Angular 7 application on IIS在 IIS 上部署 Angular 7 应用程序后清除浏览器缓存
【发布时间】:2021-05-30 19:55:21
【问题描述】:
@Component({
  selector: 'some-component',
  templateUrl: `./app/component/stuff/component.html?v=${new Date().getTime()}`,
  styleUrls: [`./app/component/stuff/component.css?v=${new Date().getTime()}`]
})

我可以像上面那样在 Angular 7 中使用吗?

我需要清除浏览器缓存。我被推荐this 回答,但这是角度2。

在 IIS 上托管的应用程序

到目前为止,我已经尝试了以下答案,但没有输出。

1)Cache busting after deploying Angular 8 application

2)How to prevent Browser cache on Angular 2 site?

3)Clear browser cache in Angular

【问题讨论】:

    标签: angular iis browser-cache


    【解决方案1】:

    您唯一需要做的就是确保 index.html 未被缓存(或缓存时间很短)请参阅How to disable caching of single page application HTML file served through IIS?。其他所有资源都是 Angular 打包的,缓存默认销毁。

    【讨论】:

    • 不缓存 index.html 怎么办?
    猜你喜欢
    • 2020-08-31
    • 1970-01-01
    • 2020-10-26
    • 2019-08-19
    • 1970-01-01
    • 1970-01-01
    • 2018-04-18
    • 1970-01-01
    • 2020-08-21
    相关资源
    最近更新 更多