Set cacheable metadata for the redirect

Created on 19 June 2024, 5 months ago

Since the parent class of \Drupal\Core\Routing\TrustedRedirectResponse is \Drupal\Core\Routing\CacheableSecuredRedirectResponse, some cacheable metadata should be set for the redirect done in the \Drupal\maintenance_mode_redirect\EventSubscriber\MaintenanceModeRedirectSubscriber class.

For example, since users could be redirected or not basing on the permission they have, the user.permissions cache context should be added to the redirect cacheable metadata. In this way, when permissions change, the redirect is automatically removed from the cache.

This is a task for the 2.x branch only, since Drupal 7 does not have cache tags nor cacheable metadata.

📌 Task
Status

Postponed

Version

2.0

Component

Code

Created by

🇮🇹Italy apaderno Brescia, 🇮🇹

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024