Cache remains stale for custom blocks after editing
hope this works ...

&lt;?php
abstract class BlockBase extends PluginBase implements BlockPluginInterface {
  /**
   * Returns generic default configuration for block plugins.
   *
   * @return array
   *   An associative array with the default configuration.
   */
  protected function baseConfigurationDefaults() {
    return array(
      'label' =&gt; '',
      'module' =&gt; $this-&gt;pluginDefinition['module'],
      'label_display' =&gt; BlockInterface::BLOCK_LABEL_VISIBLE,
      'cache' =&gt; array(
        'max_age' =&gt; 0,
      ),
    );
  }
}


refer to this link block cache api is removed

The following block cache constants have been replaced with the combination of the cache.max_age and ::getCacheContexts() return values (or bubbled cache contexts) on blocks:

DRUPAL_NO_CACHE (equivalent: cache.max_age = 0)
DRUPAL_CACHE_CUSTOM (equivalent: cache.max_age = 0 + Cache::keyFromQuery())
DRUPAL_CACHE_PER_ROLE (equivalent: cache.max_age &gt;0 + user.roles)
DRUPAL_CACHE_PER_USER (equivalent: cache.max_age &gt;0 + user)
DRUPAL_CACHE_PER_PAGE (equivalent: cache.max_age &gt;0 + url)
DRUPAL_CACHE_GLOBAL (equivalent: cache.max_age &gt;0, no cache contexts)