Cacheable responses should be invalidated when the relevant route config is updated

Created on 8 January 2024, over 1 year ago

Problem/Motivation

Currently when you make changes to a Route configuration entity, it should invalidate the cache for any affected responses.

This can be achieved by checking if the response object implements \Drupal\Core\Cache\CacheableResponseInterface, and if it does, then we add the RouteConfigEntityInterface config instance as a cacheable dependency.

Steps to reproduce

  1. Create a new rule for a path on an empty cache.
  2. Visit the page so that it is cached by the page_cache module.
  3. Modify and save the route config.
  4. The page cache should've been invalidated, but isn't.

Proposed resolution

Add the configuration as a cacheable dependency and let Drupal handle all the cache invalidation automatically.

Remaining tasks

Provide issue fork/patch with functional tests hopefully.

User interface changes

N/A

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024