@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回答,但这适用于 Angular 2。
托管在 IIS 上的应用程序
到目前为止,我已经尝试了以下答案,但没有输出。
1) Cache busting after deploying Angular 8 application
最佳答案
您唯一需要做的就是确保 index.html 没有被缓存(或者缓存时间很短),请参阅 How to disable caching of single page application HTML file served through IIS? 。所有其他资源均由 Angular 打包,默认情况下会破坏缓存。
关于angular - 在 IIS 上部署 Angular 7 应用程序后清除浏览器缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66419630/