Published Assets Confused

Hello everyone.

I can’t understand how asset publishing and reusing already published ones work somehow. I have 487 folder in my assets folder and these were generated in two days, I cannot imagine what will happen if my project runs more than two days. I have just four bundles that contain one or two js/css files. One of its defines “$this->sourcePath” and my assetManager’ $linkAssets is true. Now, why these folders count are high? Will Yii delete older ones after x days? Why doesn’t Yii reuse already publisheds? Could I write a deletion script?

Thanks.

Hi,

That is not unusual don’t worry.

As far as I know assets will only be published once - and then they are simply used…

Until you delete all asset folders, then they have to be published again.

I have round about 30 "root" folders in "web/assets" and round about 450 when I also count the subfolders.

There is at least ONE folder per AssetBundle.

Keep in mind that there are not only YOUR AssetBundles,

but also AssetBundles which come with Yii itself AND

AssetBundles which are "shipped" with extensions you are using…

So don’t worry - the number of folders should only change,

when you add more AssetBundles OR modify the files which are published by a bundle.

Means:

In development it is possible that the amount of folders changes often,

due to your development work… ;)

But when you are running in "production" the amount of folders should not change.

Hope this helps a littlebit.

Best Regards