Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Cache visibility between task & app
  • I use memcache as cache driver and I noticed that my app does not see \Cache::set('key', $value); saved in the task. When I try to read it from the app controller level the \Cache::get('key') is not set.
  • memcache or memcached?
  • memcached
  • HarroHarro
    Accepted Answer
    Just tried that (using the 1.8/develop codebase), and I can not reproduce it.

    Action on the oil commandline to show the value is set:

    [hverton@catwoman] $ php oil console
    Fuel 1.8-dev - PHP 5.5.12 (cli) (May  3 2014 07:09:18) [Linux]
    >>> \Cache::set('testkey', 'testvalue');
    >>> \Cache::get('testkey');
    testvalue
    >>>

    after which my test controller action

        public function action_get()
        {
            try
            {
                \Debug::dump(\Cache::get('testkey'));
            }
            catch (\CacheNotFoundException $e)
            {
                echo "Cache Miss!";
            }
            return '';
        }

    dumps "testvalue" without problems.

    You don't have a config issue because your commandline runs in a different environment from your web application?
  • Thanks. The environment was setup ok. The issue was my Google App Launcher for local development. The web app is using GAE implementation of memcached and CLI php regular PHP memcached extension, so they are completely different memcache implementations.

    Sorry for taking up your time, but good know tip to build knowledge base ;) 

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion