function view($id = null) { // checking cache $id = $this->Article->id; //For the sake of demonstration, let’s throw in some extra parameters. Let’s say that for this query, not only does the Article ID matter, but it also uses a random number for the query (bear with me here). And while we’re at it we’ll also act like the User’s id matters. Here’s how we’d make it cache accordingly: $quanta = rand(); $user_id = $this->YourAuthComponent->user[‘id’]; $key = $id.’-‘.$quanta.’-‘.$user_id; //This will always be specific to the case, while lacking any extra trimmings. $data = $this->icache->cache(null, ‘articles’, ‘view’, $key); if (empty($data)) { //So this line basically translates to: “If(no valid cache was found)”. $results = $this->Article->read(); //Do query. $data = $this->icache->c($results, ‘articles’, ‘view’, $key, ‘+2 days’); //Cache query for 2 days. } $this->set('article',$data); }