Views field cache tags does not invalidate the views cache I've implemented CacheableDependencyInterface on my ViewsField plugin.

  /**
   * {@inheritdoc}
   */
  public function getCacheTags() {
    return ['arbitrary_tag'];
  }


I can see the tag on the HEADER and the View configuration object.

However, when that tag is invalidated, the View is not updated.

I've also tried using adding cache tags to the render method:

return [
  '#markup' =&gt; $message,
  '#cache' =&gt; [
    'tags' =&gt; ['my_list'],
  ],
];


Both to the Views field, but also tried directly on the View element using hook_views_pre_view

While debugging, I've made sure to try invalidate that specific tag:

Cache::invalidateTags(['my_list']);


While debugging further it seems like that the ResultRow values are still cached after clearing the tag.
Although there are Views plugins which use CacheableDependencyInterface, I'm not sure it is the right way for a field plugin, because a field renders content and a cache tag of rendered content belongs in the render array.

This was discussed in this issue for block plugins. Don't know if this here or in the other issues for blocks is a core issues, because you can see in both core modules the effort to collect plugin cacheable metadata, or Drupal assumes, that all render arrays fulfill the requirements outlined in the docs:


  "It is of the utmost importance that you inform the Render API of the
  cacheability of a render array"


Anyways, an easy fix is to put the cache tag in the rendered output of the field.