Wrong caching of embedded views block I am having trouble with the Cache API in Drupal 8.
I embedded a views block with pagination through a field preprocess function into a node. When caching is off, I can normally use the pager and will always get the right results, but once caching is one, every block page (e.g. /node/1?page=2) shows the same block content rendering the pager useless.

I assume my hacky method is preventing the node cache to let the view in the field handle it's own caching, hence I always get the content from the page I visited first after clearing cache.

This is how the view is embedded:

function foo_preprocess_field(&amp;$variables) {
  $field_name = $variables['field_name'];

  if($field_name === 'bar'){
      foreach ($variables['items'] as &amp;$item) {
        $item['content'] = views_embed_view($item['content']['#markup']);
      }
   }
}
I think you need to add the pager context to item #cache