浏览代码

Adjustments to excessive image density

Gaël Métais 1 年之前
父节点
当前提交
2977506cb8
共有 2 个文件被更改,包括 14 次插入14 次删除
  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,
         "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": "<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,
-        "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",

+ 1 - 1
lib/metadata/scoreProfileGeneric.json

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