首页 > 解决方案 > 在 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 小时的缓存?

标签: angularjsgoogle-chromecachingiismemorycache

解决方案


推荐阅读