Custom block disable caching? I've created a custom module to show On This Days in a block but they are not changing each day until I flush the caches.
I call the entity:
public function build() {
    $query = \Drupal::entityQuery('node');
    $query-&gt;condition('status', 1);
    $query-&gt;condition('type', 'on_this_day');
    $query-&gt;condition('field_filter_date', '-' . date(&quot;m-d&quot;), 'CONTAINS');
    $entity_ids = $query-&gt;execute();

...
and then return from the build function like this:
return array(
        '#markup' =&gt; $content,
        '#cache' =&gt; array(
            'max-age' =&gt; 0,
        ),

Any ideas?
I'm thinking entity cache or something but I'm quite new to this and not too sure
The way to invalid the Cache in a Block is with
  /**
   * {@inheritdoc}
   */
  public function getCacheMaxAge() {
    return 0;
  }

This comes from BlockBase