Invalidate cached responses when new redirects are added

Created on 21 May 2025, 19 days ago

Problem/Motivation

When a redirect is detected, the redirect entity is added to the response as a cacheable dependency. The response then may be cache by, for example, Dynamic Page Cache. When that redirect is changed or deleted, the response is invalidated by the entity cache tags of the redirect.

However, because of the possibility of having redirect chains, a new redirect that affects the response may be created but the response may still be served from the cache - sending the user to the wrong page.

Steps to reproduce

Proposed resolution

Add the redirect_list cache tag to redirection responses, or analyze the cases and, for example, load redirects that could be affected by adding a new one in their chain and invalidate the entity cache tags for those redirects.

Remaining tasks

Ideally, implement the more accurate solution.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇵🇪Peru krystalcode

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

Comments & Activities

Production build 0.71.5 2024