Is it possible to use a separate cache config for an element?

For instance, I have a global element that I know will be the same
across all of my apps, so I have a directory that I want to use to
store such cached elements:

/path/to/global/tmp/cache/

Whereas the rest of the app is stored in:

/path/to/app/tmp/cache/

I have a separate config set for my cache:

Cache::config('global',
    array(
        'engine' => 'File',
        'duration'=> '+1 week',
        'probability'=> 100,
        'path' => /path/to/global/tmp/cache/
    )
);

But I don't see any way to set the config to use for an element in the
view. There is a $cache variable in the render method, but it does not
accept "config" parameter:

// DOES NOT WORK! 'CONFIG' DOES NOTHING!
$this->element('global_element', array( 'cache' => array( 'time' =>
'+2 days', 'config' => 'global' ) );

This cached file is still put into /path/to/app/tmp/cache/view/
instead of /path/to/global/tmp/cache/view/. Is there some way I can
alter that?

Thanks,
    - Jim

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to