public function onRoute(MvcEvent $e)
    {
        if (!$e->getRequest() instanceof HttpRequest || !$e->getResponse() instanceof HttpResponse) {
            return null;
        }

        /** @var HttpResponse $response */
        $response = $e->getResponse();

        $data = $this->getCacheService()->load($e);

        if ($data !== null) {
            $this->loadedFromCache = true;

            if ($this->getOptions()->getCacheResponse() === true) {
                $response = unserialize($data);
            } else {
                $response = $e->getResponse();
                $response->setContent($data);
            }

            $this->addDebugResponseHeader($response, 'Hit');

            return $response;
        }

        $this->addDebugResponseHeader($response, 'Miss');
    }