Aggregator page contents could be empty due to missing cache context

Issue information

From user: mfb

Contribution record

Fork management

Problem/Motivation

If an aggregator page without feed items is requested - e.g. the feed only has a few pages worth of feed items but aggregator?page=10000 is requested - the empty page will be cached by the dynamic page cache without a cache context set. Later requests for aggregator will incorrectly return this empty page.

Steps to reproduce

  1. Install dynamic page cache module.
  2. Request a page beyond the number of feed items available, e.g. aggregator?page=10000; page contents will be correctly empty in this case as there are no feed items to display.
  3. Request a page that should list feed items, e.g. aggregator
  4. The resulting page contents will be empty because the cache of the initial page=10000 is returned.

Proposed resolution

Pager cache context should be set in all cases, even if there are no items being displayed.

Remaining tasks

Review patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information