cache set in custom table not working? I am trying to set cache with in my custom created cache table which is created with below code: 

function custom_activity_dashboard_schema() {
  $schema = array();
  $schema['activity_dashboard_cache'] = drupal_get_schema_unprocessed('system', 'cache');
  return $schema;
}

function custom_activity_dashboard_update_7021(){
  $schema = custom_activity_dashboard_schema();
  if(!db_table_exists('activity_dashboard_cache')) {
    db_create_table('activity_dashboard_cache', $schema['activity_dashboard_cache']);
  }
}


Table created looks like screenshot : 



Just added simplly this code to test if cache entry get created or not :

   $cache_time = '+10 minutes';
   $expire = strtotime($cache_time);

  $t_revisions = total_revisions();

  // set cache 
  cache_set("total_revisions", $t_revisions, 'activity_dashboard_cache', $expire);

  // get and print cache value
  $cache = cache_get("total_revisions",'activity_dashboard_cache');
  echo $cache-&gt;data;


with above code there is no entry in database table when I run query to see :



But when I print value by cache get it prints value that was cached on my page. 

I am not able to figure out what I am doing wrong and why cacnot I see entires in database table but the value after cache get is printed. 

Please suggest what I am doing worng.

With same code I can see entires in database table on my loacl environment. 

UPDATE :

We are using redis and entity_cache for full site.

Thanks!
If you are using redis, wouldn't your cache bins not be controlled in the Drupal database anymore? You would therefore need to explicitly set the cache bin to use DrupalDatabaseCache so that it uses the Drupal database in settings.php. 

Example: 

$conf['cache_class_activity_dashboard_cache'] = 'DrupalDatabaseCache';


This is how it used to be done with Memcache... Redis should be the same, but check the README:

http://cgit.drupalcode.org/redis/tree/README.txt?h=7.x-3.x

It would explain why you can query this on your local machine, if you only have Redis configuration set for the remote environments running it. You are querying the database, but the cache is pulling from Redis.

This is for Memcache, but sheds more light on excluding certain cache, like cache_form - which remains in the database. https://www.drupal.org/node/1131468