DevTools: Remove proxy caching audit.

Don't consider must-revalidate as uncacheable

BUG=520353

Review URL: https://codereview.chromium.org/1294473004

git-svn-id: svn://svn.chromium.org/blink/trunk@200950 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8910d08f
...@@ -72,7 +72,6 @@ WebInspector.AuditCategories.NetworkUtilization.prototype = { ...@@ -72,7 +72,6 @@ WebInspector.AuditCategories.NetworkUtilization.prototype = {
this.addRule(new WebInspector.AuditRules.MinimizeDnsLookupsRule(4), WebInspector.AuditRule.Severity.Warning); this.addRule(new WebInspector.AuditRules.MinimizeDnsLookupsRule(4), WebInspector.AuditRule.Severity.Warning);
this.addRule(new WebInspector.AuditRules.ParallelizeDownloadRule(4, 10, 0.5), WebInspector.AuditRule.Severity.Warning); this.addRule(new WebInspector.AuditRules.ParallelizeDownloadRule(4, 10, 0.5), WebInspector.AuditRule.Severity.Warning);
this.addRule(new WebInspector.AuditRules.BrowserCacheControlRule(), WebInspector.AuditRule.Severity.Severe); this.addRule(new WebInspector.AuditRules.BrowserCacheControlRule(), WebInspector.AuditRule.Severity.Severe);
this.addRule(new WebInspector.AuditRules.ProxyCacheControlRule(), WebInspector.AuditRule.Severity.Warning);
}, },
__proto__: WebInspector.AuditCategoryImpl.prototype __proto__: WebInspector.AuditCategoryImpl.prototype
......
...@@ -747,7 +747,7 @@ WebInspector.AuditRules.CacheControlRule.prototype = { ...@@ -747,7 +747,7 @@ WebInspector.AuditRules.CacheControlRule.prototype = {
_isExplicitlyNonCacheable: function(request) _isExplicitlyNonCacheable: function(request)
{ {
var hasExplicitExp = this.hasExplicitExpiration(request); var hasExplicitExp = this.hasExplicitExpiration(request);
return !!this.responseHeaderMatch(request, "Cache-Control", "(no-cache|no-store|must-revalidate)") || return !!this.responseHeaderMatch(request, "Cache-Control", "(no-cache|no-store)") ||
!!this.responseHeaderMatch(request, "Pragma", "no-cache") || !!this.responseHeaderMatch(request, "Pragma", "no-cache") ||
(hasExplicitExp && !this.freshnessLifetimeGreaterThan(request, 0)) || (hasExplicitExp && !this.freshnessLifetimeGreaterThan(request, 0)) ||
(!hasExplicitExp && !!request.url && request.url.indexOf("?") >= 0) || (!hasExplicitExp && !!request.url && request.url.indexOf("?") >= 0) ||
...@@ -835,46 +835,6 @@ WebInspector.AuditRules.BrowserCacheControlRule.prototype = { ...@@ -835,46 +835,6 @@ WebInspector.AuditRules.BrowserCacheControlRule.prototype = {
__proto__: WebInspector.AuditRules.CacheControlRule.prototype __proto__: WebInspector.AuditRules.CacheControlRule.prototype
} }
/**
* @constructor
* @extends {WebInspector.AuditRules.CacheControlRule}
*/
WebInspector.AuditRules.ProxyCacheControlRule = function() {
WebInspector.AuditRules.CacheControlRule.call(this, "http-proxycache", WebInspector.UIString("Leverage proxy caching"));
}
WebInspector.AuditRules.ProxyCacheControlRule.prototype = {
runChecks: function(requests, result, callback)
{
this.execCheck(WebInspector.UIString("Resources with a \"?\" in the URL are not cached by most proxy caching servers:"),
this._questionMarkCheck, requests, result);
this.execCheck(WebInspector.UIString("Consider adding a \"Cache-Control: public\" header to the following resources:"),
this._publicCachingCheck, requests, result);
this.execCheck(WebInspector.UIString("The following publicly cacheable resources contain a Set-Cookie header. This security vulnerability can cause cookies to be shared by multiple users."),
this._setCookieCacheableCheck, requests, result);
},
_questionMarkCheck: function(request)
{
return request.url.indexOf("?") >= 0 && !this.hasResponseHeader(request, "Set-Cookie") && this.isPubliclyCacheable(request);
},
_publicCachingCheck: function(request)
{
return this.isCacheableResource(request) &&
!this.isCompressible(request) &&
!this.responseHeaderMatch(request, "Cache-Control", "public") &&
!this.hasResponseHeader(request, "Set-Cookie");
},
_setCookieCacheableCheck: function(request)
{
return this.hasResponseHeader(request, "Set-Cookie") && this.isPubliclyCacheable(request);
},
__proto__: WebInspector.AuditRules.CacheControlRule.prototype
}
/** /**
* @constructor * @constructor
* @extends {WebInspector.AuditRule} * @extends {WebInspector.AuditRule}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment