From 2977506cb826ee4916e5cb97ad9f6ecb11c4d639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 16 Aug 2023 07:57:01 +0200 Subject: [PATCH] Adjustments to excessive image density --- lib/metadata/policies.js | 26 +++++++++++++------------- lib/metadata/scoreProfileGeneric.json | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/metadata/policies.js b/lib/metadata/policies.js index d399031..1dcf3a2 100644 --- a/lib/metadata/policies.js +++ b/lib/metadata/policies.js @@ -54,7 +54,7 @@ var policies = { "isBadThreshold": 2000, "isAbnormalThreshold": 4000, "hasOffenders": false, - "unit": 'ms' + "unit": "ms" }, "DOMaccesses": { "tool": "domAccessAgregator", @@ -734,7 +734,7 @@ var policies = { "isBadThreshold": 3145728, "isAbnormalThreshold": 5242880, "hasOffenders": true, - "unit": 'bytes' + "unit": "bytes" }, "imagesNotOptimized": { "tool": "phantomas", @@ -744,7 +744,7 @@ var policies = { "isBadThreshold": 204800, "isAbnormalThreshold": 307200, "hasOffenders": true, - "unit": 'bytes', + "unit": "bytes", "valueTransformFn": function(offenders) { let totalGain = 0; offenders.forEach((offender) => { @@ -765,7 +765,7 @@ var policies = { "isBadThreshold": 512000, "isAbnormalThreshold": 819200, "hasOffenders": true, - "unit": 'bytes', + "unit": "bytes", "valueTransformFn": function(offenders) { let totalGain = 0; offenders.forEach((offender) => { @@ -786,7 +786,7 @@ var policies = { "isBadThreshold": 307200, "isAbnormalThreshold": 512000, "hasOffenders": true, - "unit": 'bytes', + "unit": "bytes", "valueTransformFn": function(offenders) { let totalGain = 0; offenders.forEach((offender) => { @@ -803,11 +803,11 @@ var policies = { "tool": "phantomas", "label": "Excessive image density", "message": "

This metric measures the number of bytes that could be saved by going further than just resizing images.

Devices with very high pixel density screen (such as 3x or 4x) are programmed to load high density images. This is the normal behavior, however the human eye barely sees the difference over 2x. This metric alerts you if an image density is > 2.2x.

There is currently no browser functionnality to prevent the issue (for this reason its impact on global score is low). But you can build your own clever solution!

", - "isOkThreshold": 0, - "isBadThreshold": 10, - "isAbnormalThreshold": 20, + "isOkThreshold": 102400, + "isBadThreshold": 307200, + "isAbnormalThreshold": 512000, "hasOffenders": true, - "unit": 'bytes', + "unit": "bytes", "valueTransformFn": function(offenders) { let totalGain = 0; offenders.forEach((offender) => { @@ -837,7 +837,7 @@ var policies = { "isBadThreshold": 204800, "isAbnormalThreshold": 409600, "hasOffenders": true, - "unit": 'bytes' + "unit": "bytes" }, "fileMinification": { "tool": "redownload", @@ -847,7 +847,7 @@ var policies = { "isBadThreshold": 61440, "isAbnormalThreshold": 122880, "hasOffenders": true, - "unit": 'bytes' + "unit": "bytes" }, "totalRequests": { "tool": "redownload", @@ -943,7 +943,7 @@ var policies = { "isOkThreshold": 0, "isBadThreshold": 102400, "isAbnormalThreshold": 204800, - "unit": 'bytes', + "unit": "bytes", "hasOffenders": true, "offendersTransformFn": function(offenders) { return offenders; @@ -969,7 +969,7 @@ var policies = { "isBadThreshold": 51200, "isAbnormalThreshold": 122880, "hasOffenders": true, - "unit": 'bytes' + "unit": "bytes" }, "oldHttpProtocol": { "label": "HTTP protocols", diff --git a/lib/metadata/scoreProfileGeneric.json b/lib/metadata/scoreProfileGeneric.json index 0962689..5019a70 100644 --- a/lib/metadata/scoreProfileGeneric.json +++ b/lib/metadata/scoreProfileGeneric.json @@ -22,7 +22,7 @@ "fileMinification": 2, "identicalFiles": 2, "emptyRequests": 3, - "notFound": 2, + "notFound": 2 } }, "images": {