lessphp icon indicating copy to clipboard operation
lessphp copied to clipboard

Auto compile to slow

Open danyj opened this issue 13 years ago • 0 comments

I used your instructions for autocompile as advised here

http://leafo.net/lessphp/docs/#compiling_automatically since checkedCompile only checks the master less file and none of the @import ones.

The issue is that when you are importing all bootstrap files ( 38 imports ) the page load increases tremendously since the compile must check for all of them on every page load in order to generate/not generate the css file ,

It is ok if you have 4-5 import files but bootstrap is killing it.

is there any faster way ?

I tried both

this

$cache          = $less->cachedCompile($input_less);
file_put_contents($output_css, $cache["compiled"]);
$last_updated   = $cache["updated"];
$cache          = $less->cachedCompile($cache);

if ($cache["updated"] > $last_updated) {
    file_put_contents($output_css, $cache["compiled"]);
}

and your autoCompileLess()

it takes up to 10-15 sec on each page load , whereas checkedCompile does this only once until it is changed again.

danyj avatar Sep 22 '12 22:09 danyj