\Drupal\views\Plugin\views\argument\ArgumentPluginBase should allow subplugins to specify a more specific url cache context

Created on 30 June 2015, about 10 years ago
Updated 19 April 2024, over 1 year ago

Problem/Motivation

From #2501905-2: \Drupal\views\Plugin\views\argument_default\QueryParameter should specify a more specific cache context :

  public function getCacheContexts() {
    $contexts = [];
    // By definition arguments depends on the URL.
    // @todo Once contexts are properly injected into block views we could pull
    //   the information from there.
    $contexts[] = 'url';

Currently, adding an argument to a view makes the view cacheable per url even if the argument value depends only on a single query argument value.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

11.0 🔥

Component
Views 

Last updated about 2 hours ago

Created by

🇫🇮Finland olli

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Last patch seems for 8.9?

  • First commit to issue fork.
  • @chrisolof opened merge request.
  • 🇺🇸United States chrisolof

    Merge request 12896 opened against 11.x. It contains the changes from the patch in comment 42 with a slightly improved post-update hook (param and return types declared + lower memory consumption by not loading all of the site's views in one go).

    Needs review.

    In our site this issue was contributing to render cache pile-ups for teaser/search result-type entity displays that lean on views for certain content (content that does not actually vary by URL).

  • 🇺🇸United States smustgrave

    Still needs a summary update.

Production build 0.71.5 2024