// fetch data if (($data = $cache->get($key) === false) { // do what needs to be cached $data = timeAndResourceExpensiveOperation(); // define tags $tags[‘tag_1’,’pageId_x’]; // store data (forever) $cache->set($key,$data,$tags,0) } // use data return $data; Sudhaus7 GENERAL PATTERN
considers all necessary context that defines the current state and result • tags - related information on which this cache should be purged • cacheFrontend - the mechanism which handles the data • cacheBackend - the mechanism which stores the data
• Plugin - Where does it run in? • Source - where is it read from? • Target - in what context is it displayed? • Page • Column • Language • Actor - who is using the website? Sudhaus7
when the cache-clear for the page with this pid is called • an Extbase Controller Action can return the content. If it does not return the content, $this->view->render() will be called.