Disabling view blocks cache I have added a views block through my twig template file (page.html.twig) through Twig_tweaks. It looks like this {{ drupal_view('view_name', 'block_name') }}.

I would like to disable caching for that particular block, but changes to the preprocess_views_view, seem to have no effect. Any suggestions to disable caching for just this one views block?

Any help very much appreciated.
You can use

function hook_block_view_BASE_BLOCK_ID_alter(array &amp;$build, \Drupal\Core\Block\BlockPluginInterface $block) {
  //Change the title of the specific block.
  $build['#cache']['max-age'] = 0;
}


Also note that this does not disable the page cache for anonymous users. If you need that too, then you also need:


  \Drupal::service('page_cache_kill_switch')->trigger();