Using cache tags for a particular node list Caching in Drupal 8 is great, but documentation is thin (at this time) on using cache tags for render arrays in Drupal 8.

I have some code that basically generates a list of node teasers, say for content types "books" and "magazines". I'm caching the list to speed things up. I would like to refresh the list every time a "book" or "magazine" is added/deleted/edited. So I have a render array that looks like this:

$build = array(
  '#type' =&gt; 'markup',
  '#markup' =&gt; $sMarkup,        
  '#cache' =&gt; [
    'keys' =&gt; ['home-all','home'],
    'tags'=&gt; ['node_list'], // invalidate cache when any node content is added/changed etc.
    'max-age' =&gt; '36600', // invalidate cache after 10h
  ],
);


By using the cache tag ['node_list'], the cache invalidates properly when content is added or edited, but will also invalidate when a content type not being listed here is changed, say "casette".

What cache tags can I use to limit the invalidation to when only "book" or "magazine" is added/changed/deleted? I've tried using: ['book_list','magazine_list']
but that doesn't work.
Starting Drupal 8.9.0, there is a new ENTITY_TYPE_list:BUNDLE cache tag added (see the change record).
So in your case you would simply need to tag our list with node_list:book.
https://www.drupal.org/node/3107058