public function setDocument($url, RemoteDocument $document)
    {
        // Process the context
        if (isset($document->document->{'@context'}) && is_object($document->document->{'@context'})) {
            $this->processContext((array)$document->document->{'@context'});
        }

        // Save the document to the cache
        $docUrlHash     = $this->getCacheHash($url, self::SLOT_DOC);
        $cachedDocument = Cache::getAdapter()->getItem($docUrlHash);
        $cachedDocument->set($document);
        Cache::getAdapter()->save($cachedDocument);

        // Return the document
        return $document;
    }