Closed ovaisbawany closed 7 years ago
Method invalidateCache()
automatically called in afterSave()
function
https://github.com/yii2mod/yii2-settings/blob/master/models/SettingModel.php#L107
you are right, its working, but now I have observed that its updating the back-end cache but not front-end cache as my UI module lies in back-end of yii2 advance structure. I used the common config for settings class. Please can you help me that how can I invalidateCache()
both front-end and back-end cache on updating from back-end.
TIA
Yii2 by default in the advanced
template use one cache component for both applications
https://github.com/yiisoft/yii2-app-advanced/blob/master/common/config/main.php#L9
You need to use one cache component for your application, or you need to override SettingModel and Settings component.
Resolved with your guidance, I was using the common cache but I never configured the cache path, so it was saving cache in different folders. This given line solved the problem 'cachePath' => '@common/runtime/cache',
Thank you for your support, your component is very valuable and useful.
Thanks :)
When I update the config values via given UI module, it does not update the cache and returns old values on get calls. I tried calling method
invalidateCache()
via code and after that, values get updated. can anyone please suggest me that how can I update my cache whenever any create or update applied on the Settings from UI panel. thanks.