When I added Yiibooster library to my website, it seems to slow page loading. When I remove the Yiibooster files, it becomes fast again.
It is slow without using any Yiibooster components. when I click on ‘Home’, 'About, or ‘Contact us’ link, the page gets blanked “white” and loads after 2 seconds.
www.jrowser.com, my test site. This is on a dedicated server.
Since all bootstrap files are preloaded, I tried to remove some files that I don’t think I will be using, especially the folder bootstrap/assets/js/ckeditor, which is more than 3MB. I’m not sure if this is good or if it won’t cause problems in the future, but it helped the page loading speed.
Please, check the following function on the bootstrap/components/Bootstrap component:
public function getAssetsUrl()
{
if (isset($this->_assetsUrl))
return $this->_assetsUrl;
else
{
$assetsPath = Yii::getPathOfAlias('bootstrap.assets');
$assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG); // <----- Your YII_DEBUG is telling whether to forceCopy or not
return $this->_assetsUrl = $assetsUrl;
}
}
i realized a test on a fresh generated app on my localhost using the apache ab tool, sending 1000 requests, five at a time to the contact page :
ab -n 1000 -c 5 http//localhost/myProject/index.php?r=site/contact
the results where:
when using default Chris’s bootsrtap -> the website can process 20.07 requests per second.
when using the default booster -> the website can process 1.41 requests per second.
when using booster after replacing YII_DEBUG by false on bootstrap/components/Bootstrap (line 458) -> the website can process 21.89 requests per second. wish is almost the same as the first test.
i think that @bit0123 solution is a must do when we are in production. the gain in speed is more than 15 times.
exactly 24.46 requests per second is what the same app that i’m testing can process in my localhost when using yii’s default theme with the blueprint css framework.
i suppose that things will be different when a project become more complex and after use of more booster components. maybe we got to test that later & compare with other css themes or frameworks. but for now. the beauty of my fresh app thanks to booster & twitter’s bootstrap is worth