Osclass cache functions

I tried using Osclass cache functions like used in Category model, however, I can’t make it get info from cache no matter what. Got any ideas?

Here’s my (a bit simplified) function.

<?php 
function listWhere($where = array(), $limit = null, $page = null, $length = null) {
	$key = md5(osc_base_url().'MemberDir:listWhere:'.implode(',', $where).$limit.$page);
	$found = null;
	$cache = osc_cache_get($key, $found);

	if($cache === false) {
		$this->dao->select('u.pk_i_id, u.dt_reg_date, u.s_name, pp.s_name as s_profile_pic, pp.e_status as e_profile_pic_status');
		$this->dao->from($this->getTableName().' u');
		$this->dao->join(DB_TABLE_PREFIX.'t_user_profilepic pp', 'u.pk_i_id = pp.fk_i_user_id', 'LEFT');
		if(is_array($where)) {
			foreach($where as $whr) {
				$this->dao->where($whr);
			}
		}
		if (!is_null($page) && !is_null($length)) {
			$this->dao->limit(($page - 1) * $length, $length);
		} else if(!is_null($limit)) {
			$this->dao->limit($limit);
		}
		$result = $this->dao->get();
		if($result === false) {
			return array();
		}

		$r = $result->result();
		osc_cache_set($key, $r, OSC_CACHE_TTL);
		return $r;
	}

	return $cache;
}
?>

Sorry for tagging you guys, but I need some professional help. :wink: @navjottomer @web-media @xiris

With memcache it works, but with default Osclass cache no.

Cache call seems fine to me. What you are getting in return?

If not using any caching engine I get the result straight from the database.

Try to check this:

osc_cache_get()

How is it analyzing without memcached?

I have a fork where I isolated the cache library, might be easier to analyse.
Wanted to make this part of the renaming and restructuring project