protected function _afterRender(KControllerContextInterface $context)
    {
        if(empty($this->_output))
        {
            $view   = $this->getView();
            $cache  = $this->_getCache($this->_getGroup(), 'output');
            $key    = $this->_getKey();

            $data  = array();

            //Store the unrendered view output
            if($view instanceof KViewTemplate)
            {
                $data['component'] = (string) $view->getTemplate()->render();

                $buffer = JFactory::getDocument()->getBuffer();
                if(isset($buffer['modules'])) {
                    $data['modules'] = array_intersect_key($buffer['modules'], array_flip($this->_modules));
                }
            }
            else $data['component'] = $context->result;

            $cache->store(serialize($data), $key);
        }
    }