Search code examples
yii2yii-extensionsyii-componentsyii2-advanced-app

Why yii2 folders of vendors and extension are so big


I am using yii2 advance template in my website and depend mainly on its extensions and widgets the folder of the website is very big even the website is not big and I am just starting website whole folder size: 111 MB vendor :30 MB Frontend Module folder: 40 MB frontend/web/assets folder :17 MB runtime/logs folder 18 MB

Assets are too big how to make it smaller
could you please recommend any solutions for this


Solution

  • Your site might be small but you are obviously instantiating a lot of widgets which require a lot of 3rd party code. Normally the assets folder is a lot smaller and on production it will be.

    In development the assets folder will in fact constantly change since you don't want static assets when developing as such your assets folder will be larger in development than production, always. Yii2, if I remember right, works based upon a probability of deleting (like PHP sessions do) as such the excess space you might be seeing is in fact Yii2 not having the probability to delete it.

    One way is to clear it out yourself and then refresh the page. If the assets folder is still too big then you, as @ronydavid mentioned, need to look into the widgets you use.