angular - 在 IIS 上部署 Angular 7 应用程序后清除浏览器缓存

标签 angular iis browser-cache

@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

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

3) Clear browser cache in Angular

最佳答案

您唯一需要做的就是确保 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/

相关文章:

IISExpress 日志文件位置

c# - System.Data.Linq.dll 上的堆栈溢出异常

javascript - 使用 Javascript 进行图像缓存 - ajax 重新加载它们

angular - 无法解析 HttpHeaders 的所有参数

Angular 9 构建包目录

angular - 使用带有嵌套 ngfor 的模板

javascript - 基于 html 标签的选择性浏览器缓存(即 donut )/其他没有 ASP?

angular - 如何使用 Angular 5 中的数据绑定(bind)设置日期输入字段的值?

asp.net - 通过身份验证 - IIS 和 dotNet

google-chrome-devtools - 我如何知道我的 index.html 是否缓存在我的 CRA 应用程序中?为什么它不存在于网络选项卡中?