First in mymodule.install I declared mymodule_schema(hook_schema) mymodule_install() and mymodule_unistall()
Where mymodule_schema() is like this:
function mymodule_schema() {
$schema = array();
$schema['cache_mymodule'] = drupal_get_schema_unprocessed('system', 'cache');
return $schema;
}
this worked perfectly and table cache_mymodule
with the same structue as table cache was created.
But in my code, using this:
$cid=some_calcuated_cid();
$cache=cache_get($cid,'cache_mymodule');
if (!$cache){
$data = some_calcuated_data();
cache_set($cid,$data,'cache_mymodule');
dpm('CACHE SET');
else {
dpm('used cache');
}
I always get 'CACHE SET', Now if i change 'cache_mymodule' to just cache, Or remove it, It works perfectly (saying used cache), Am I missing some hook in mymodule?