From 96b3b944df42de3716a1847646876399fd362be4 Mon Sep 17 00:00:00 2001 From: Anastasia Date: Wed, 5 Sep 2018 14:39:15 +0300 Subject: [PATCH] html compress --- frontend/config/main.php | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------- 1 file changed, 55 insertions(+), 47 deletions(-) diff --git a/frontend/config/main.php b/frontend/config/main.php index 01baa10..129e53a 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -438,53 +438,61 @@ use common\models\Settings; SlashRedirect::className(), ], ], - 'assetsAutoCompress' => [ - 'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent', - 'enabled' => false, - - 'readFileTimeout' => 3, - //Time in seconds for reading each asset file - - 'jsCompress' => true, - //Enable minification js in html code - 'jsCompressFlaggedComments' => true, - //Cut comments during processing js - - 'cssCompress' => true, - //Enable minification css in html code - - 'cssFileCompile' => true, - //Turning association css files - 'cssFileRemouteCompile' => false, - //Trying to get css files to which the specified path as the remote file, skchat him to her. - 'cssFileCompress' => true, - //Enable compression and processing before being stored in the css file - 'cssFileBottom' => false, - //Moving down the page css files - 'cssFileBottomLoadOnJs' => false, - //Transfer css file down the page and uploading them using js - - 'jsFileCompile' => true, - //Turning association js files - 'jsFileRemouteCompile' => false, - //Trying to get a js files to which the specified path as the remote file, skchat him to her. - 'jsFileCompress' => true, - //Enable compression and processing js before saving a file - 'jsFileCompressFlaggedComments' => true, - //Cut comments during processing js - - 'htmlCompress' => true, - //Enable compression html - 'noIncludeJsFilesOnPjax' => true, - //Do not connect the js files when all pjax requests - 'htmlCompressOptions' => //options for compressing output result - [ - 'extra' => false, - //use more compact algorithm - 'no-comments' => true - //cut all the html comments - ], - ], + 'assetsAutoCompress' => [ + 'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent', + 'enabled' => true, + + 'readFileTimeout' => 3, + //Time in seconds for reading each asset file + + 'jsCompress' => true, + //Enable minification js in html code + 'jsCompressFlaggedComments' => true, + //Cut comments during processing js + + 'cssCompress' => true, + //Enable minification css in html code + + 'cssFileCompile' => true, + //Turning association css files + 'cssFileRemouteCompile' => false, + //Trying to get css files to which the specified path as the remote file, skchat him to her. + 'cssFileCompress' => true, + //Enable compression and processing before being stored in the css file + 'cssFileBottom' => false, + //Moving down the page css files + 'cssFileBottomLoadOnJs' => false, + //Transfer css file down the page and uploading them using js + + 'jsFileCompile' => true, + //Turning association js files + 'jsFileRemouteCompile' => false, + //Trying to get a js files to which the specified path as the remote file, skchat him to her. + 'jsFileCompress' => true, + //Enable compression and processing js before saving a file + 'jsFileCompressFlaggedComments' => true, + //Cut comments during processing js + + 'htmlCompress' => true, + //Enable compression html + 'noIncludeJsFilesOnPjax' => true, + //Do not connect the js files when all pjax requests + 'htmlFormatter' => [ + //Enable compression html + 'class' => 'skeeks\yii2\assetsAuto\formatters\html\TylerHtmlCompressor', + 'extra' => true, //use more compact algorithm + 'noComments' => true, //cut all the html comments + 'maxNumberRows' => 50000, //The maximum number of rows that the formatter runs on + + //or + + // 'class' => 'skeeks\yii2\assetsAuto\formatters\html\MrclayHtmlCompressor', + + //or any other your handler implements skeeks\yii2\assetsAuto\IFormatter interface + + //or false + ], + ], ], 'params' => $params, -- libgit2 0.21.4