Problem with sharing a cache variable between console-application and web-application

I’m trying to “fill” a variable (array) in CFileCache with a console command (with some entries from database) and then access it in my web application, but I always get only “null”.

am i doing something wrong, or does yii keep the caches from console and webapp separate?

It should work once you’ve configured an id for your application (both in console and app config). This id will be used to prefix your cache IDs. If it is not set, it will be constructed from application’s basepath and the application name. And if I remember correctly, the latter differs between web app and console app after generating a new app using yiic.

I’ll note that if you’re using APC, the CLI and the web server will have separate caches, regardless of what you specify as your configuration variables.