angularjs - 在 Chrome 中 1 小时后清除浏览器内存缓存
问题描述
我面临内存缓存清理的问题。
我没有在缓存标头中设置任何最大年龄。请在下面找到 IIS HTTP 响应标头设置
下面是应用程序的 Httpservice 代码:
constructor($http: ng.IHttpService,
$q: ng.IQService, $rootScope: ng.IRootScopeService,
exceptionHandlerSerice: IExceptionHandlerService) {
$http.defaults.headers.common["X-XSS-Protection"] = "1; mode=block";
$http.defaults.headers.common["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload";
$http.defaults.headers.common["X-Content-Type-Options"] = "nosniff";
$http.defaults.headers.common["Cache-control"] = "no-store";
$http.defaults.headers.common["Pragma"] = "no-cache";
this.$http = $http;
this.$q = $q;
this.$rootScope = $rootScope;
this.exceptionHandler = exceptionHandlerSerice;
}
如何避免 Chrome 清理 1 小时的缓存?
解决方案
推荐阅读
- python - 如何将列表数据附加到现有的 XML 文件?
- git - 通过github上的项目创建生成时如何将.gitignore链接到本地项目?
- c# - Entity Framework Core Value Conversion - 在查询中使用比较或其他函数
- mips - MIPS 移位量位数
- jupyter-notebook - 如何在jupyter的markdown中插入图像并导出为PDF
- nginx - NGINX QUIC 反向代理
- javascript - 单击后如何永久禁用按钮,使用循环从服务器数据创建的按钮?
- javascript - 再次单击播放时,它会在旧音频之上播放新音频
- sas - SAS 转换和缺失数据
- javascript - JSX 不与 map 函数一起在条件渲染上渲染