Switch trivial page cache policy handlers to use no_cache option instead

Created on 20 August 2015, over 9 years ago
Updated 20 March 2025, 23 days ago

Problem/Motivation

The node module implements src/PageCache/DenyNodePreview.php to prevent node previews from being cached, but this can be done much simpler and with less code.

When @Fabianx and @catch reviewed a custom-entity type I implemented based on the node module, they noted there were simpler ways to prevent the entity from being cached during previews. One being the proposed resolution here, the other being setting max_age = 0 on the controller. The goal of this patch is to perform the same simplification cleanup here, too.

Proposed resolution

Remove src/PageCache/DenyNodePreview.php, the reference in node.services.yml, and just add a no_cache: TRUE in node.routing.yml.

Testing

With these changes in place, make sure node previews aren't cached.

User interface changes

N/A

API changes

N/A

📌 Task
Status

Needs work

Version

11.0 🔥

Component

node system

Created by

🇮🇹Italy jeremy Tuscany

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024