Sfoglia il codice sorgente

Adjustments to excessive image density

Gaël Métais 1 anno fa
parent
commit
2977506cb8
2 ha cambiato i file con 14 aggiunte e 14 eliminazioni
  1. 13 13
      lib/metadata/policies.js
  2. 1 1
      lib/metadata/scoreProfileGeneric.json

+ 13 - 13
lib/metadata/policies.js

@@ -54,7 +54,7 @@ var policies = {
         "isBadThreshold": 2000,
         "isBadThreshold": 2000,
         "isAbnormalThreshold": 4000,
         "isAbnormalThreshold": 4000,
         "hasOffenders": false,
         "hasOffenders": false,
-        "unit": 'ms'
+        "unit": "ms"
     },
     },
     "DOMaccesses": {
     "DOMaccesses": {
         "tool": "domAccessAgregator",
         "tool": "domAccessAgregator",
@@ -734,7 +734,7 @@ var policies = {
         "isBadThreshold": 3145728,
         "isBadThreshold": 3145728,
         "isAbnormalThreshold": 5242880,
         "isAbnormalThreshold": 5242880,
         "hasOffenders": true,
         "hasOffenders": true,
-        "unit": 'bytes'
+        "unit": "bytes"
     },
     },
     "imagesNotOptimized": {
     "imagesNotOptimized": {
         "tool": "phantomas",
         "tool": "phantomas",
@@ -744,7 +744,7 @@ var policies = {
         "isBadThreshold": 204800,
         "isBadThreshold": 204800,
         "isAbnormalThreshold": 307200,
         "isAbnormalThreshold": 307200,
         "hasOffenders": true,
         "hasOffenders": true,
-        "unit": 'bytes',
+        "unit": "bytes",
         "valueTransformFn": function(offenders) {
         "valueTransformFn": function(offenders) {
             let totalGain = 0;
             let totalGain = 0;
             offenders.forEach((offender) => {
             offenders.forEach((offender) => {
@@ -765,7 +765,7 @@ var policies = {
         "isBadThreshold": 512000,
         "isBadThreshold": 512000,
         "isAbnormalThreshold": 819200,
         "isAbnormalThreshold": 819200,
         "hasOffenders": true,
         "hasOffenders": true,
-        "unit": 'bytes',
+        "unit": "bytes",
         "valueTransformFn": function(offenders) {
         "valueTransformFn": function(offenders) {
             let totalGain = 0;
             let totalGain = 0;
             offenders.forEach((offender) => {
             offenders.forEach((offender) => {
@@ -786,7 +786,7 @@ var policies = {
         "isBadThreshold": 307200,
         "isBadThreshold": 307200,
         "isAbnormalThreshold": 512000,
         "isAbnormalThreshold": 512000,
         "hasOffenders": true,
         "hasOffenders": true,
-        "unit": 'bytes',
+        "unit": "bytes",
         "valueTransformFn": function(offenders) {
         "valueTransformFn": function(offenders) {
             let totalGain = 0;
             let totalGain = 0;
             offenders.forEach((offender) => {
             offenders.forEach((offender) => {
@@ -803,11 +803,11 @@ var policies = {
         "tool": "phantomas",
         "tool": "phantomas",
         "label": "Excessive image density",
         "label": "Excessive image density",
         "message": "<p>This metric measures the number of bytes that could be saved by going further than just resizing images.<p>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.</p><p>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!</p>",
         "message": "<p>This metric measures the number of bytes that could be saved by going further than just resizing images.<p>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.</p><p>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!</p>",
-        "isOkThreshold": 0,
-        "isBadThreshold": 10,
-        "isAbnormalThreshold": 20,
+        "isOkThreshold": 102400,
+        "isBadThreshold": 307200,
+        "isAbnormalThreshold": 512000,
         "hasOffenders": true,
         "hasOffenders": true,
-        "unit": 'bytes',
+        "unit": "bytes",
         "valueTransformFn": function(offenders) {
         "valueTransformFn": function(offenders) {
             let totalGain = 0;
             let totalGain = 0;
             offenders.forEach((offender) => {
             offenders.forEach((offender) => {
@@ -837,7 +837,7 @@ var policies = {
         "isBadThreshold": 204800,
         "isBadThreshold": 204800,
         "isAbnormalThreshold": 409600,
         "isAbnormalThreshold": 409600,
         "hasOffenders": true,
         "hasOffenders": true,
-        "unit": 'bytes'
+        "unit": "bytes"
     },
     },
     "fileMinification": {
     "fileMinification": {
         "tool": "redownload",
         "tool": "redownload",
@@ -847,7 +847,7 @@ var policies = {
         "isBadThreshold": 61440,
         "isBadThreshold": 61440,
         "isAbnormalThreshold": 122880,
         "isAbnormalThreshold": 122880,
         "hasOffenders": true,
         "hasOffenders": true,
-        "unit": 'bytes'
+        "unit": "bytes"
     },
     },
     "totalRequests": {
     "totalRequests": {
         "tool": "redownload",
         "tool": "redownload",
@@ -943,7 +943,7 @@ var policies = {
         "isOkThreshold": 0,
         "isOkThreshold": 0,
         "isBadThreshold": 102400,
         "isBadThreshold": 102400,
         "isAbnormalThreshold": 204800,
         "isAbnormalThreshold": 204800,
-        "unit": 'bytes',
+        "unit": "bytes",
         "hasOffenders": true,
         "hasOffenders": true,
         "offendersTransformFn": function(offenders) {
         "offendersTransformFn": function(offenders) {
             return offenders;
             return offenders;
@@ -969,7 +969,7 @@ var policies = {
         "isBadThreshold": 51200,
         "isBadThreshold": 51200,
         "isAbnormalThreshold": 122880,
         "isAbnormalThreshold": 122880,
         "hasOffenders": true,
         "hasOffenders": true,
-        "unit": 'bytes'
+        "unit": "bytes"
     },
     },
     "oldHttpProtocol": {
     "oldHttpProtocol": {
         "label": "HTTP protocols",
         "label": "HTTP protocols",

+ 1 - 1
lib/metadata/scoreProfileGeneric.json

@@ -22,7 +22,7 @@
                 "fileMinification": 2,
                 "fileMinification": 2,
                 "identicalFiles": 2,
                 "identicalFiles": 2,
                 "emptyRequests": 3,
                 "emptyRequests": 3,
-                "notFound": 2,
+                "notFound": 2
             }
             }
         },
         },
         "images": {
         "images": {