|
@@ -1130,6 +1130,35 @@ var policies = {
|
|
|
"isAbnormalThreshold": 1,
|
|
|
"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": {
|
|
|
"tool": "phantomas",
|
|
|
"label": "Connections closed",
|
|
@@ -1250,7 +1279,6 @@ var policies = {
|
|
|
domain: parts[1],
|
|
|
requests: parseInt(parts[2])
|
|
|
};
|
|
|
-
|
|
|
})
|
|
|
};
|
|
|
}
|