I'm writing my first Yii2 application and I want to disable the assets caching, while I'm developing.
Can I disable the caching using the ./config/ .php files?
I'm writing my first Yii2 application and I want to disable the assets caching, while I'm developing.
Can I disable the caching using the ./config/ .php files?
1) Globally it's possible with help of AssetMananer. There is special option $forceCopy for this.
You can set it like this with component:
Or in application config:
2) If you want disable caching in specific AssetBundle, use $publishOptions property:
Alternatively you can specify this like in option 1 with help of bundles property. For example:
But this:
is more flexible, because it disables this asset bundle caching only in debug mode, but allows on production server.
YII_DEBUG
is set inweb/index.php
.