Drupal 8 block cacheing
It all depends on what you want to do exactly.  I have a block that is dependent on the user thats logged in, and it may also be changed from time to time based on some other code being run.

In this example  

'#cache'=&gt;[
        'contexts'=&gt; [
            'user',
            'route',
        ],
        'tags' =&gt; [
          'Block:smn',
        ],
      ],


It gives it context for which to cache and the tag allows me to invalidate the cache for just this block if I run some other code that will affect what is rendered

in this example if some entity is deleted i use hook_entity_delete

function foo_entity_delete($entity){
    $cache = \Drupal::service('cache_tags.invalidator')-&gt;invalidateTags(array('Block:smn'));

}


and my block will be removed from cache and the next time I visit the page it will be rendered with new information.

for more info on tags, and contexts you can cache with:
https://api.drupal.org/api/drupal/core!core.api.php/group/cache/8.2.x