Skip to content

Commit

Permalink
Update: Use array of non-critical resource types (#2191)
Browse files Browse the repository at this point in the history
  • Loading branch information
stramel authored and paulirish committed May 9, 2017
1 parent 0e80b61 commit bd7f862
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lighthouse-core/gather/computed/critical-request-chains.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ class CriticalRequestChains extends ComputedArtifact {
* @param {any} request
*/
isCritical(request) {
// XHRs are fetched at High priority, but we exclude them, as they are unlikely to be critical
const resourceTypeCategory = request._resourceType && request._resourceType._category;
if (resourceTypeCategory === WebInspector.resourceTypes.XHR._category) {
return false;
}

// XHRs are fetched at High priority, but we exclude them, as they are unlikely to be critical
// Images are also non-critical.
if (resourceTypeCategory === WebInspector.resourceTypes.Image._category) {
const nonCriticalResourceTypes = [
WebInspector.resourceTypes.Image._category,
WebInspector.resourceTypes.XHR._category
];
if (nonCriticalResourceTypes.includes(resourceTypeCategory)) {
return false;
}

Expand Down

0 comments on commit bd7f862

Please sign in to comment.