private function processTemplate() { $file = str_replace('/', '_', $this->uri); self::initCache(); if (tellme('use_cache') === true && $this->__Cache->isStored($file)) { // read cache $this->res->write($this->__Cache->read($file)); } else { // create page object $Page = new Page(); // process template request $Page->processTemplate($file); // get rendered template $buffer = $Page->transform(); // write rendered cache if (tellme('use_cache') === true) { $this->__Cache->write($buffer, $file); } // stream output $this->res->write($buffer); } // end call }