protected function getKey(FragmentCache $configuration, Request $subRequest, Request $masterRequest)
    {
        $event = new KeyGenerationEvent($configuration, $subRequest, $masterRequest);

        $keyRequest = sha1($subRequest->getRequestUri())
            . ':'
            . sha1($masterRequest->getRequestUri());

        $key = array(
            'AndresMontanezFragmentCache',
            $this->environment,
            'v' . $configuration->getVersion(),
            $keyRequest
        );

        $this->dispatcher->dispatch(KeyGenerationEvent::NAME, $event);
        if (count($event->getKeys()) > 0) {
            $key = array_merge($key, $event->getKeys());
        }

        $key = implode(':', $key);
        return $key;
    }