简体   繁体   中英

How to stop Yii's LESS from making my application slow?

I got this:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\APP\www\protected\extensions\less\lib\lessphp\lessc.inc.php on line 504

I think it might have to do with this:

'components'=>array(
  'less'=>array(
    'class'=>'ext.less.components.LessCompiler',
    'forceCompile'=>true, // indicates whether to force compiling
    //'compress'=>false, // indicates whether to compress compiled CSS
    //'debug'=>false, // indicates whether to enable compiler debugging mode
    'paths'=>array(
      'less/style.less'=>'css/style.css',
    ),
  ),
  1. Does forceCompile mean the css files gets regenerated every time?
  2. Would this slow down my application?
  3. If I don't force compile, will it be faster?
  4. Is there anything else I can do to speed up my app?

Try by this settings:

    'components'=>array(
    'less'=>array(
    'class'=>'ext.less.components.LessCompiler',
    'forceCompile'=>YII_DEBUG, // indicates whether to force compiling
    //'compress'=>false, // indicates whether to compress compiled CSS
    //'debug'=>false, // indicates whether to enable compiler debugging mode
    'paths'=>array(
      'less/style.less'=>'css/style.css',
    ),
   ),

Change your forceCompile = YII_DEBUG. IN DEBUG Mode Set 'forceCompile'=>true. When you work on Debug increase the PHP MAX Execution time

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM