0

In Yii 2, when I add a few code rows to my JavaScript file, that has a cache, it will not accept my additional code to the JavaScript file.

How can I fix this problem?

fmw42
  • 46,825
  • 10
  • 62
  • 80
  • 1
    Possible duplicate of [Yii2 assets clear cache](https://stackoverflow.com/questions/24819220/yii2-assets-clear-cache) – Insane Skull Sep 01 '17 at 06:11

2 Answers2

0

You need to add forceCopy option in asset manager under components :

'components' => [
    'assetManager' => [
        'class' => 'yii\web\AssetManager',
        'forceCopy' => true,
    ],
],
Insane Skull
  • 9,220
  • 9
  • 44
  • 63
0

In my case I did it by chanding version in asset file where i include this js:

 public $js = [
    'js/script.js?0.0.1',
];
vityapro
  • 178
  • 1
  • 13