Cache remains stale for custom blocks after editing My Drupal 8 website consists of multiple custom blocks created from the drupal backend user interface.

As I went from dev to production settings and activating Internal Dynamic Page Cache (set to 1 minute), the custom block content doesn't change on the actual site after editing (for both anonymous and authenticated users). If I go back to editing mode, the changes are persisted as expected.

The changes are visible when I clear the caches (i.e. drush cache-rebuild). I don't have any issues with my own blocks that implements the Block plugin and has a max-age set. Nodes works works as expected too.

What could be wrong?
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)