Preprocessed block not udpating after edit I am preprocessing a block which seems to get cache and not showing the updated content on front end after getting edit.

My preprocess code looks like:- 

/**
 * Implements hook_preprocess_block().
 */
function mymodule_aboutus_preprocess_block(&amp;$variables) {
  $act_on_blocks = array(
    'myblockid',
  );
  if (!in_array($variables['elements']['#id'], $act_on_blocks)) {
    return;
  }
  $block = $variables['elements']['content']['#block_content'];
  $body = $variables['content']['body'];
  switch ($variables['elements']['#id']) {
    case 'myblockid':
      $variables['myblock_data']['field_title'] = t('Credits');
      $variables['myblock_data']['field_description'] = $body;
      break;
  }
}

- On Twig template
&lt;div{{ attributes.addClass(classes) }}&gt;
  {{ title_prefix }}
  {% if label %}
    &lt;h2{{ title_attributes }}&gt;{{ label }}&lt;/h2&gt;
  {% endif %}
  {{ title_suffix }}
  {% block content %}
    {% include "@mytheme/myblock-partial" with {
      "title": myblock_data['field_title'],
      "content": myblock_data['field_description'],
    } only %}
  {% endblock %}
&lt;/div&gt;
Drupal 8 caching background in breif:-

Drupal 8 has strong and awesome caching mechanism. 

Basically any renderable array is now get cached by default and drupal provides cache API to manage in what context
(could be in context of user/route etc.)(cache contetx), when to invalidate the cache(cache tags) and till when it should
be cached could be Permanent cache(max-age=-1) or no caching at all(max-age=0)

So the renderable array Cache API works around


Cache Context
Cache Tags
max-age


The problem with my code was excessive preprocessing on block content and then avoid {{ content }} to print on block 
twig template, so {{ content }} itself take care of '#cache' attribute but since I avoided it during preprocessing 
and printed only my custom exposed variables drupal was never able to figure out when to invalidate the cache, and 
blocks were permanent cached.

Solution:
I just made sure I am also passing the '#cache' attribute to my renderable arrays and then used the same on twig template

  // - Example during preprocessing

    /**
     * Implements hook_preprocess_block().
     */
    function cfr_world_aboutus_preprocess_block(&amp;$variables) {
      $act_on_blocks = array(
        'myblockid',
      );
      if (!in_array($variables['elements']['#id'], $act_on_blocks)) {
        return;
      }
      $block = $variables['elements']['content']['#block_content'];
      $body = $variables['content']['body'];
      switch ($variables['elements']['#id']) {
        case 'myblockid':
          $variables['myblock_data']['field_title'] = t('Credits');
          $variables['myblock_data']['field_description'] = $body;
          // Added drupal cache attribute
          $variables['myblock_data']['#cache'] = $variables['elements']['content']['#cache'];
          break;
      }
    }

    // - On Twig template
    &lt;div{{ attributes.addClass(classes) }}&gt;
      {{ title_prefix }}
      {% if label %}
        &lt;h2{{ title_attributes }}&gt;{{ label }}&lt;/h2&gt;
      {% endif %}
      {{ title_suffix }}
      {% block content %}
        {# Added to pass cache attribute#}
        {{ myblock_data| without('field_title','field_description') }}
        {% include "@mytheme/myblock-partial" with {
          "title": myblock_data['field_title'],
          "content": myblock_data['field_description'],
        } only %}
      {% endblock %}
    &lt;/div&gt;