And next time, would you bother clicking on 'reply all', so the mailing list is also added?
-- Best Regards, Pieter Kokx PHP Developer Zend Framework developer
whisher@mp4.it schreef:
Hi Pieter,
Well actually it doesn't cache anything :(
if I use Apc while it works (do cache)
with File.
Regards,
Bye.
--- Messaggio originale ---
Hi,
How exactly do you mean with 'this doesn't work'? Doesn't it cache
anything or what?
Regards,
Pieter Kokx
PHP Developer
Zend Framework developer
whisher schreef:
> Hi.
> I don't understand why this works with File
> doesn't work with with Apc
> protected function _initCache()
> {
> $dir = Zend_Registry::get('dir');
> $frontendOptions = array(
> 'caching'=> true,
> 'cache_id_prefix' => null,
> 'lifetime' => 7200,
> 'logging' => false,
> 'write_control'=> true,
> 'automatic_serialization' => true,
> 'automatic_cleaning_factor' => 10,
> 'ignore_user_abort'=> false,
> );
> $backendOptions = array(
> 'cache_dir' => $dir->cache
> );
> $cache = Zend_Cache::factory('Core', 'File', $frontendOptions,
> $backendOptions);
> //$cache = Zend_Cache::factory('Core', 'Apc', $frontendOptions);
> Zend_Registry::set('cache', $cache);
>
> }
>
> In the model
> public function fetchItems($lang)
> {
> $cache = Zend_Registry::get('cache');
> if(!$data = $cache->load('RightFetchTags')) {
> // do select
> $data = $table->fetchAll($select)->toArray();
> $cache->save($data, 'RightFetchTags');
> }
> return $data;
> }
>
> Bye
>
--- Dada Music Movement, tutta la musica che vuoi! ---
没有评论:
发表评论