I'm learning the new caching system. For testing purposes I have turned off Page Cache and Dynamic Page Cache.
I've set a custom block with the following:
<some code>
$build_array = $view_builder->view($referenced_entity, self::VIEW_MODE, self::LANG_CODE);
$build_array['#cache']['contexts'][] = "route";
$build_array['#cache']['keys'] = ['mymodule_panels_blocks','taxonomy_term', $term->id()];
This is for displaying an eck entity with an image that is attached to a taxonomy term.
The expected behavior is that when I point the term to a different eck entity, the taxonomy term is invalidated.
When I check the full list of tags (using http.response.debug_cacheability_headers: true) I see my taxonomy term listed (taxonomy_term:209).
So it would seem I'm all set up. Yet when I change the eck entity to a new one, click Save, then click View, I see the old image still.
When I flush the render cache, I see my new image.
Isn't the invalidation of the taxonomy term automatic when the term is saved? Or do I have to write a hook to invalidate the taxonomy term when it changes?