|
@@ -872,16 +872,26 @@ var policies = {
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"unit": 'bytes'
|
|
"unit": 'bytes'
|
|
},
|
|
},
|
|
- "fileMinification": {
|
|
|
|
|
|
+ "gzipCompression": {
|
|
"tool": "weightChecker",
|
|
"tool": "weightChecker",
|
|
- "label": "File minification",
|
|
|
|
- "message": "<p>This is the weight that could be saved if all text resources were correctly minified.</p><p>The tools in use here are <b>UglifyJS</b>, <b>clean-css</b> and <b>HTMLMinifier</b>. These tools are so good that some of your minified files can be marked as unminified. Change your tool it this happens :)</p><p>The gains of minification are generally small, but the impact can be high when these text files are loaded on the critical path.</p>",
|
|
|
|
|
|
+ "label": "Gzip compression",
|
|
|
|
+ "message": "<p>Mesures the number of bytes that could be saved by compressing file transfers.</p><p>Gzip is a powerfull weight reducer and should be enabled on text-based assets in your server's configuration. Note that gzipping small files (< 1 KB) is arguable, and that some assets such as images should not be gzipped as they are already compressed. <a href=\"https://gist.github.com/gmetais/971ce13a1fbeebd88445\" target=\"_blank\">Here</a> is a list of Content-Types that should be gzipped.</p>",
|
|
"isOkThreshold": 20480,
|
|
"isOkThreshold": 20480,
|
|
"isBadThreshold": 81920,
|
|
"isBadThreshold": 81920,
|
|
"isAbnormalThreshold": 153600,
|
|
"isAbnormalThreshold": 153600,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"unit": 'bytes'
|
|
"unit": 'bytes'
|
|
},
|
|
},
|
|
|
|
+ "fileMinification": {
|
|
|
|
+ "tool": "weightChecker",
|
|
|
|
+ "label": "File minification",
|
|
|
|
+ "message": "<p>This is the weight that could be saved if all text resources were correctly minified.</p><p>The tools in use here are <b>UglifyJS</b>, <b>clean-css</b> and <b>HTMLMinifier</b>. These tools are so good that some of your minified files can be marked as unminified. Change your tool it this happens :)</p><p>The gains of minification are generally small, but the impact can be high when these text files are loaded on the critical path.</p>",
|
|
|
|
+ "isOkThreshold": 10240,
|
|
|
|
+ "isBadThreshold": 76800,
|
|
|
|
+ "isAbnormalThreshold": 122880,
|
|
|
|
+ "hasOffenders": true,
|
|
|
|
+ "unit": 'bytes'
|
|
|
|
+ },
|
|
"requests": {
|
|
"requests": {
|
|
"tool": "phantomas",
|
|
"tool": "phantomas",
|
|
"label": "Total requests number",
|
|
"label": "Total requests number",
|
|
@@ -1099,35 +1109,6 @@ var policies = {
|
|
"isAbnormalThreshold": 1,
|
|
"isAbnormalThreshold": 1,
|
|
"hasOffenders": true
|
|
"hasOffenders": true
|
|
},
|
|
},
|
|
- "assetsNotGzipped": {
|
|
|
|
- "tool": "phantomas",
|
|
|
|
- "label": "Not gzipped",
|
|
|
|
- "message": "<p>This is the number of requests that should be compressed with gzip but aren't.</p><p>Gzip is a powerfull weight reducer and should be enabled on text-based assets in your server's configuration. Note that gzipping small files (< 1 KB) is arguable, and that some assets such as images should not be gzipped as they are already compressed. <a href=\"https://gist.github.com/gmetais/971ce13a1fbeebd88445\" target=\"_blank\">Here</a> is a list of Content-Types that should be gzipped.</p>",
|
|
|
|
- "isOkThreshold": 0,
|
|
|
|
- "isBadThreshold": 12,
|
|
|
|
- "isAbnormalThreshold": 20,
|
|
|
|
- "hasOffenders": true,
|
|
|
|
- "offendersTransformFn": function(offenders) {
|
|
|
|
- return {
|
|
|
|
- count: offenders.length,
|
|
|
|
- list: offenders.map(function(offender) {
|
|
|
|
- var parts = /^([^ ]*) \((.+)\)$/.exec(offender);
|
|
|
|
-
|
|
|
|
- if (!parts) {
|
|
|
|
- debug('assetsNotGzipped offenders transform function error with "%s"', offender);
|
|
|
|
- return {
|
|
|
|
- parseError: offender
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return {
|
|
|
|
- file: parts[1],
|
|
|
|
- type: parts[2]
|
|
|
|
- };
|
|
|
|
- })
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
"closedConnections": {
|
|
"closedConnections": {
|
|
"tool": "phantomas",
|
|
"tool": "phantomas",
|
|
"label": "Connections closed",
|
|
"label": "Connections closed",
|