Updated: Comment #0

Problem/Motivation

#1712456: How to leverage cache tags in Views introduced cache tags for Views. And there was rejoicing :)

Unfortunately, I found a few pesky problems :( (While investigating #2183017: Views doesn't bubble up rendered entities' cache tags.)

Steps to reproduce

  1. Install Drupal 8 in the Standard profile.
  2. Edit the front page view (at admin/structure/views/view/frontpage) and enable tag-based caching.
  3. Create one node (with a title, a taxonomy term or two and something in the body field), that is visible on the front page.
  4. Visit the front page. Now you will have some data in your cache_views_results DB table.
The "results" cache entry
Cache ID: frontpage:page_1:results:<something like e7266527aeec0343c0f02bc762f6e9f7ddc3708b36fe774c7f5fc0a0ed708a3e>
Cache tags: view:frontpage node_view:1 node:1 node_view_article:1
As you can see, the cache tags for the taxonomy terms and the author user are missing.
The "output" cache entry
Cache ID: frontpage:page_1:output:<something like ebd8521f12c0efa33b507a11561c55f882ab8be5c9c0fdb2d28cc0f0685e12de>
Cache tags: view:frontpage node_view:1 node:1 node_view_article:1
The same remarks as for the "results" cache entry apply… with one added caveat: in this case, the cache tag for the text format used in the body field should also appear!
In other words, the cache tags in this case should be a superset of the cache tags generated for the rendered entities and their fields… which in fact makes this problem almost exactly #2183017: Views doesn't bubble up rendered entities' cache tags, but not quite.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

None.

API changes

TBD

Comments

wim leers’s picture

Issue tags: +Spark
damiankloip’s picture

Not really sure the best way do deal with this particular issue, as views mainly care about tables, which is why entities in relationships works. Wouldn't this need to look at the entity type, get the field definitions, then check if there are any references for fields like author? But also, only when this is using the entity row style plugin. As fields could not be showing anything about the related stuff, or it could.... can go both ways :/

wim leers’s picture

dawehner’s picture

wim leers’s picture

Status: Postponed » Active

#2318377: Determine whether a view is cacheable and its required contexts, store this i/t config entity landed, so this is unblocked now. I don't understand why this issue was blocked on that one though.

wim leers’s picture

Status: Active » Fixed

Therefore, there is nothing left to do here!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.