

Here is where I’m completely out of my league according to Crell, “f you, you’re wrong and you should fix your code “, but I’m not sure how to get a rendered view without using render() myself… I’ve implemented a variation on a comment on by mikejw suggesting using different render context to prevent Drupal from complaining.

Content is often reused across multiple pages and the cached object could be. You will not be surpised to see the “leaked metadata was detected” error again… In fact you have come to love and expect this error at this point. Cache contexts are used when a dependency exists on an environment-specific object. $response->addCacheableDependency(CacheableMetadata::createFromRenderArray($view_render_array)) $response->addCacheableDependency($node) If you have drush version 8, try this command: drush config-delete ttings. In such a way we can explicitly decide as to when the cache of the element will be invalidated based on the context. So you have to delete this configuration object before you again install bootstrap. $rendered_view = render($view_render_array) ttings probably exists because it has remained over from last time you installed bootstrap. 8.2.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType 8.2.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php. These are converted to a final value depending on the request.

contexts specifies one or more cache context IDs. $view = \Drupal\views\Views::getView("frontpage") Drupal 8 provides several kinds out of the box: max-age stores cache data by defining its time in integer format and seconds tags is an array of one or more cache tags identifying the data this element depends on.
