Commit b6fe06114b7659e0d0903da02115c1a7daf039cb
1 parent
4fb757d2
-Compression config
Showing
1 changed file
with
58 additions
and
8 deletions
Show diff stats
frontend/config/main.php
| ... | ... | @@ -14,15 +14,65 @@ |
| 14 | 14 | 'id' => 'app-frontend', |
| 15 | 15 | 'homeUrl' => '/', |
| 16 | 16 | 'basePath' => dirname(__DIR__), |
| 17 | - 'bootstrap' => [ 'log' ], | |
| 17 | + 'bootstrap' => [ | |
| 18 | + 'log', | |
| 19 | + 'assetsAutoCompress', | |
| 20 | + ], | |
| 18 | 21 | 'controllerNamespace' => 'frontend\controllers', |
| 19 | 22 | 'components' => [ |
| 20 | - 'request' => [ | |
| 23 | + 'assetsAutoCompress' => [ | |
| 24 | + 'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent', | |
| 25 | + 'enabled' => true, | |
| 26 | + | |
| 27 | + 'readFileTimeout' => 3, | |
| 28 | + //Time in seconds for reading each asset file | |
| 29 | + | |
| 30 | + 'jsCompress' => true, | |
| 31 | + //Enable minification js in html code | |
| 32 | + 'jsCompressFlaggedComments' => true, | |
| 33 | + //Cut comments during processing js | |
| 34 | + | |
| 35 | + 'cssCompress' => true, | |
| 36 | + //Enable minification css in html code | |
| 37 | + | |
| 38 | + 'cssFileCompile' => true, | |
| 39 | + //Turning association css files | |
| 40 | + 'cssFileRemouteCompile' => false, | |
| 41 | + //Trying to get css files to which the specified path as the remote file, skchat him to her. | |
| 42 | + 'cssFileCompress' => true, | |
| 43 | + //Enable compression and processing before being stored in the css file | |
| 44 | + 'cssFileBottom' => false, | |
| 45 | + //Moving down the page css files | |
| 46 | + 'cssFileBottomLoadOnJs' => false, | |
| 47 | + //Transfer css file down the page and uploading them using js | |
| 48 | + | |
| 49 | + 'jsFileCompile' => true, | |
| 50 | + //Turning association js files | |
| 51 | + 'jsFileRemouteCompile' => false, | |
| 52 | + //Trying to get a js files to which the specified path as the remote file, skchat him to her. | |
| 53 | + 'jsFileCompress' => true, | |
| 54 | + //Enable compression and processing js before saving a file | |
| 55 | + 'jsFileCompressFlaggedComments' => true, | |
| 56 | + //Cut comments during processing js | |
| 57 | + | |
| 58 | + 'htmlCompress' => true, | |
| 59 | + //Enable compression html | |
| 60 | + 'noIncludeJsFilesOnPjax' => true, | |
| 61 | + //Do not connect the js files when all pjax requests | |
| 62 | + 'htmlCompressOptions' => //options for compressing output result | |
| 63 | + [ | |
| 64 | + 'extra' => false, | |
| 65 | + //use more compact algorithm | |
| 66 | + 'no-comments' => true | |
| 67 | + //cut all the html comments | |
| 68 | + ], | |
| 69 | + ], | |
| 70 | + 'request' => [ | |
| 21 | 71 | 'class' => LanguageRequest::className(), |
| 22 | 72 | 'csrfParam' => '_csrf-frontend', |
| 23 | 73 | 'baseUrl' => '', |
| 24 | 74 | ], |
| 25 | - 'user' => [ | |
| 75 | + 'user' => [ | |
| 26 | 76 | 'identityClass' => 'common\models\User', |
| 27 | 77 | 'enableAutoLogin' => true, |
| 28 | 78 | 'identityCookie' => [ |
| ... | ... | @@ -30,11 +80,11 @@ |
| 30 | 80 | 'httpOnly' => true, |
| 31 | 81 | ], |
| 32 | 82 | ], |
| 33 | - 'session' => [ | |
| 83 | + 'session' => [ | |
| 34 | 84 | // this is the name of the session cookie used for login on the frontend |
| 35 | 85 | 'name' => 'advanced-frontend', |
| 36 | 86 | ], |
| 37 | - 'log' => [ | |
| 87 | + 'log' => [ | |
| 38 | 88 | 'traceLevel' => YII_DEBUG ? 3 : 0, |
| 39 | 89 | 'targets' => [ |
| 40 | 90 | [ |
| ... | ... | @@ -46,13 +96,13 @@ |
| 46 | 96 | ], |
| 47 | 97 | ], |
| 48 | 98 | ], |
| 49 | - 'errorHandler' => [ | |
| 99 | + 'errorHandler' => [ | |
| 50 | 100 | 'errorAction' => 'site/error', |
| 51 | 101 | ], |
| 52 | - 'urlManager' => [ | |
| 102 | + 'urlManager' => [ | |
| 53 | 103 | 'class' => SeoUrlManager::className(), |
| 54 | 104 | 'enablePrettyUrl' => true, |
| 55 | - 'redirects' => [ | |
| 105 | + 'redirects' => [ | |
| 56 | 106 | DirectRedirects::className(), |
| 57 | 107 | ], |
| 58 | 108 | 'showScriptName' => false, | ... | ... |