Problem/Motivation

As identified in #2241377: [meta] Profile/rationalise cache tags, the extension:views cache tag is invalidated a lot, and it is not really clear why it exists. Identify similar cache tags and other code that can be improved in/for views data/plugin caches.

Proposed resolution

Changes done in this issue:
- Remove the extension:views cache tag
- Remove usage of the config:core.extension cache tag in views plugin managers, they rely on the plugin cache clearer now.
- Replace the deleteAll() calls and invalidations of that cache tag with an explicit call to invalidate the views data cache. We currently can't think of any example why a field config change would require changes in cached views, so that is removed. If a specific field requires that, it can add a cache tag for the relevant field.
- Remove the config:core.extension cache tag invalidation in system_list_reset(), that is called repeatedly during dfac() calls and is not needed anymore.
- Removal of manual views data cache clears in a lot of tests, that no longer need it due to the updated hooks.
- Some test fixes that we don't really know why they were passing before.

Remaining tasks

User interface changes

API changes

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because too many invalidations is a bug.
Issue priority Normal, because the impact was not measured.
Prioritized changes The main goal of this issue is performance as cache invalidations need unnecessary SQL queries and even might remove too many cache items.
Disruption Not disruptive as its unlikely someone would have used those cache tags and need them invalidated.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
4.7 KB

This is likely too bold, but let's see what is failing...

Status: Needs review » Needs work

The last submitted patch, 1: remove-views-cache-tags-2443485-1.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
8.67 KB
5.92 KB

Ok, so the field_config hooks are important, but I think we can make them nicer. I'm not sure about the render part, but instead of clearing that directly, we should maybe add the views data tag to views caches?

Status: Needs review » Needs work

The last submitted patch, 3: remove-views-cache-tags-2443485-3.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
3.55 KB
12.22 KB

I'm speechless.

Berdir’s picture

The patch removes the deleteAll() from render bin when fields are changed.

We don't know why it is there, but we said that if someone depends on field settings, then it should just add the relevant cache tags (Do we need a method on the view so that something like a filter plugin can do that?)

Wim Leers’s picture

Issue tags: +D8 cacheability, +VDC

Great clean-up so far!

Berdir’s picture

Issue summary: View changes
FileSize
8.64 KB
662 bytes

Updated the issue summary.

Also removed the field_config_list cache tag again, that was just a test.

I don't think there's something left to do here.

drush cr before this shows one invalidation of config:core.extension and 19 invalidations of config:core.extension and extension:views in my more or less clean installation.

They're all gone with this patch.

Status: Needs review » Needs work

The last submitted patch, 8: 2443485-8.patch, failed testing.

dawehner’s picture

@berdir
Did you removed the changes in #5 on purpose?

Berdir’s picture

Status: Needs work » Needs review
FileSize
12.19 KB

No, I did it because I'm stupid :)

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Thats ready for RTBC now :), but needs a beta eval.

Fabianx’s picture

Category: Task » Bug report

Re-classifying as a bug, because too many invalidation is a bug.

Fabianx’s picture

Issue summary: View changes

Added beta evaluation.

Fabianx’s picture

Issue summary: View changes

  • catch committed 6ffc61f on 8.0.x
    Issue #2443485 by Berdir, dawehner: Remove extension:views cache tag and...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

catch’s picture

Committed/pushed to 8.0.x, thanks!

Status: Fixed » Closed (fixed)

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