Problem/Motivation
Views by default uses the full url or all the query arguments to create the result key whenever there are exposed filters or pager options. This will also include unrelated values (e.g. dom id on ajax requests or tracking values). This in effect will negate cacheability on ajax views.
Steps to reproduce
- Create view with filters and ajax.
- Access view and filter via ajax. The request includes the dom_id, which is included in the result key.
- Reload the page with the view. The dom_id has changed, so the previous result is not used.
Proposed resolution
- Change pager and filter plugins to return specific cache contexts on their query arguments
- Add cache context for ajax requests as the output might differ from a page load
- Update tests to check for correct cache contexts
Remaining tasks
- Review and refine proposed functional patch
- Rework tests to match expected output.
User interface changes
None
API changes
- Adds a new ajax cache context
Data model changes
None
Release notes snippet
Issue fork drupal-3425345
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pvbergen commentedComment #3
pvbergen commentedComment #4
pvbergen commentedComment #5
pvbergen commentedComment #7
pvbergen commentedComment #8
cilefen commentedThis seems related.