Problem/Motivation

Views has a very defensive approach to caching. While this is very safe in terms of preventing overcaching, it also can reduce performance dramtically for complex or personalized views and basically negates any caching on ajax requests.

This issue should help organize distinct topics that should each help improving the performance of views.
So far, I'm aware of the following three issues:

  • Views by default uses the generic list tag (e.g. node_list), make any cached results invalid whenever an entity of the view’s type is changed or created, see https://www.drupal.org/project/drupal/issues/3055371
  • Views by default uses the full url or all the query arguments to create the result key whenever there are exposed filters or sort options. This will also include unrelated values (e.g. dom id on ajax requests or tracking parameters). This in effect will negate any cacheability on ajax views.
  • Some filters do expensive operations every time they are loaded, e.g. taxonomy term filters (taxonomy_index_tid). The computation is independent of the input and could be cached.

Proposed resolution

- Create separate issues per distinct topic
- Adress each issue and resolve it

Remaining tasks

- #3055371: Use new cache tag ENTITY_TYPE_list:BUNDLE in Views to improve cache hit rate
- #3425345: Views caching: Use precise arguments for result key
- #3425346: Views caching: Provide caching for expensive filter options

User interface changes

None

API changes

None, all changes should be transparent outside of views.

Data model changes

None

Release notes snippet

Comments

pvbergen created an issue. See original summary.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.