Scheduling fails with Drupal Page cache

Created on 16 June 2025, 19 days ago

Problem/Motivation

When a site is using Drupal's page cache that's not set to 0 then scheduled alerts fail to display/hide until the cache is manually cleared.

Steps to reproduce

  • Enable Drupal's page cache and set it to a non-zero setting (like a day).
  • Create an alert and schedule it to go inactive in 5 minutes.
  • View the page, see the alert.
  • Come back in 6 minutes and see the alert is still there. You can observe that the 'x-drupal-cache-max-age' header is set to -1.

The proper alerts only appear/disappear if you manually clear the Drupal cache or edit an alert.

This is related to the issues addressed in πŸ“Œ Scheduling fails with Drupal page cache and cache.page.max_age set to 0 Active .

See the comment added after that issue was closed that describes this issue: https://www.drupal.org/project/sitewide_alert/issues/3189144#comment-161... πŸ“Œ Scheduling fails with Drupal page cache and cache.page.max_age set to 0 Active -- It calls out πŸ› The Sidewide Alerts load route set a maximum cache max age of 30 in an interesting spot Active as the cause of this and I believe that assessment is correct.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States azinck

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024