Archives par mot-clé : cache

PhpCache: NullDriver why ?

If you want to avoid this code in your class using the cache, the NullDriver and a possible answer. class myService { […] public function myAction() { if ($this->cache && $this->cache-exists(‘key’)) { $val = $this->cache->get(‘key’); } else { $val = $otherService->getFromWebservice(‘key’); } if ($this->cache) { $this->cache->set(‘key’,’value’); } […] } } Step 1 : In constructor, … Continuer la lecture de PhpCache: NullDriver why ?

Continuer la lecture de PhpCache: NullDriver why ?