src/ContextGenerator/JsonldContextGenerator.php
protected function writeCache(RdfMappingInterface $rdfMapping, $cid) {

    // This is how an empty json encoded @context looks like.
    $data = json_encode(['@context' => ''], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
    try {
      $data = $this->generateContext($rdfMapping);
      $this->cache->set($cid, $data, Cache::PERMANENT, $rdfMapping->getCacheTagsToInvalidate());
    }
    catch (\Exception $e) {
      $this->logger->warning("@msg",
        [
          '@msg' => $e->getMessage(),
        ]);
    }

    return $data;
  }
protected function writeCache(RdfMappingInterface $rdfMapping, $cid) {

    // This is how an empty json encoded @context looks like.
    $data = json_encode(['@context' => ''], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
    try {
      $data = $this->generateContext($rdfMapping);
      $this->cache->set($cid, $data, Cache::PERMANENT, $rdfMapping->getCacheTagsToInvalidate());
    }
    catch (\Exception $e) {
      $this->logger->warning("@msg",
        [
          '@msg' => $e->getMessage(),
        ]);
    }

    return $data;
  }
Writes JSON-LD @context cache per Entity_type bundle combo.

@param \Drupal\rdf\RdfMappingInterface $rdfMapping
Rdf mapping object.
@param string $cid
Name of the cache bin to use.

@return string
A json encoded string for the processed JSON-LD @context