Welcome Guest, Not a member yet? Register   Sign In
Redis Cache Problem
#1
Bug 

Using CI rc3 and redis (v3rc5) I am having trouble with the caching.

I can set key in the cache and read it fine until it's TTL has expired. Then it will miss and not save anything to that key anymore.

I have to go into redis and manually delete the '_ci_redis_serialized' key for it to work again.

If i change it to use file cacheing it works fine.

Has anyone else noticed this problem or is it something I am doing wrong?

PHP Code:
$this->load->driver('cache', array('adapter' => 'redis')); // in __construct()

if (! $cache $this->cache->get('allNews') ) {
 
     $query $this->db->get('news');
 
     $result $query->result_array();
 
     $this->cache->save('allNews'$result10);
 
     return $result;
} else {
 
    return $cache;

Reply
#2

If you are confident that you found a bug, better open an issue in CodeIgniter project, https://github.com/bcit-ci/CodeIgniter/issues
Reply
#3

(03-22-2015, 05:27 AM)ivantcholakov Wrote: If you are confident that you found a bug, better open an issue in CodeIgniter project, https://github.com/bcit-ci/CodeIgniter/issues

I actually found a fix. There's a flaw in the logic in the save() function in the caching engine.

I'm preparing a pull request, its my first one on github so we'll see if it works.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB