Proper way to cache custom entities with Entitycache? I am trying to figure out how to cache custom entities with Entitycache module. As I know Entitycache module doesn't support custom entites created with Entity API, that's why I'm doing like this:

created cache table for own entity: cache_entity_carroza_user

created own controller, extent EntityCacheDefaultEntityController, implemented EntityAPIControllerInterface:

class CarrozaEntityController extends EntityCacheDefaultEntityController implements EntityAPIControllerInterface {
  ...
}


implemented hook_entity_info, specified entity controller:

$return = array(
  'carroza_user' =&gt; array(
    'label' =&gt; t('Carroza User'),
    'controller class' =&gt; 'CarrozaUserEntityController',
....


if(module_exists('entitycache')) {
  $return['carroza_user']['field cache'] = FALSE;
  $return['carroza_user']['entity cache'] = TRUE;
}


created CarrozaUserEntityController:

class CarrozaUserEntityController extends CarrozaEntityController {
  public function __construct($entityType) {
    parent::__construct($entityType);
  }

  public function resetCache(array $ids = NULL) {
    EntityCacheControllerHelper::resetEntityCache($this, $ids);
    parent::resetCache($ids);
  }

  public function load($ids = array(), $conditions = array()) {
    return EntityCacheControllerHelper::entityCacheLoad($this, $ids, $conditions);
  }


  public function create(array $values = array()) {
    $values += array(
      'carroza_uid' =&gt; '',
      'is_new' =&gt; TRUE,
      ...
    );

    $carroza_user = parent::create($values);
    return $carroza_user;
  }

  public function save($carroza_user, DatabaseTransaction $transaction = NULL) {
    return parent::save($carroza_user, $transaction);
  }
}


I'm doing everything Entitycache documentation says, but can't see any records in cache_entity_carroza_user table. Am I missing something else?
entitycache.module and entity.module integrate, so that just just work.

All you need to do is make sure that the cache table for your entity table exists and set the keys in hook_entity_info() as you already do.

Not sure why it doesn't work, but I'd start by removing the custom controller and rely on the default one from entity.module.