Browse Source

Change policy text

Gaël Métais 10 years ago
parent
commit
db57f67e98
2 changed files with 2 additions and 9 deletions
  1. 1 1
      lib/metadata/policies.js
  2. 1 8
      lib/tools/weightChecker/fileMinifier.js

+ 1 - 1
lib/metadata/policies.js

@@ -875,7 +875,7 @@ var policies = {
     "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>.</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>",
+        "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": 20480,
         "isBadThreshold": 81920,
         "isAbnormalThreshold": 153600,

+ 1 - 8
lib/tools/weightChecker/fileMinifier.js

@@ -89,7 +89,6 @@ var FileMinifier = function() {
             return minifyHtml(entry.weightCheck.body)
 
             .then(function(newFile) {
-                console.log('KKKKKKKKKKKK');
                 if (!newFile) {
                     debug('Optimization didn\'t work');
                     return entry;
@@ -103,18 +102,12 @@ var FileMinifier = function() {
                     entry.weightCheck.minified = newFileSize;
                     entry.weightCheck.isMinified = false;
                     debug('Filesize is %d bytes smaller (-%d%)', fileSize - newFileSize, Math.round((fileSize - newFileSize) * 100 / fileSize));
-                } else {
-                    console.log('OOOO old file size: ' + fileSize);
-                    console.log('OOOO new file size: ' + newFileSize);
-                    console.log(entry.weightCheck);
                 }
 
                 return entry;
             })
 
             .fail(function(err) {
-                console.log('LLLLLLLLLLLLLLL');
-                console.log(err);
                 return entry;
             });
 
@@ -127,7 +120,7 @@ var FileMinifier = function() {
     }
 
     // The gain is estimated of enough value if it's over 2KB or over 20%,
-    // but it's ignored if is below 100 bytes
+    // but it's ignored if is below 400 bytes
     function gainIsEnough(oldWeight, newWeight) {
         var gain = oldWeight - newWeight;
         var ratio = gain / oldWeight;