Decorate PageCache instead of overriding definition

Created on 14 October 2024, 7 months ago

Problem/Motivation

Overriding the service definition for page cache makes this module sometimes unusable with other modules that decorate page cache, like: advanced_page_cache, page_cache_boost, etc.

Steps to reproduce

Proposed resolution

Use decoration instead of overriding the definition.

Remaining tasks

Post a PR

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇸🇮Slovenia alecsmrekar

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

Merge Requests

Comments & Activities

  • Issue created by @alecsmrekar
  • Merge request !12Issue 3480465: Decorate page cache → (Open) created by alecsmrekar
  • Pipeline finished with Failed
    7 months ago
    #308997
  • Pipeline finished with Failed
    7 months ago
    #309003
  • 🇮🇹Italy plach Venezia

    This is looking good and working well, but I'd perform a small tweak.

  • Pipeline finished with Running
    7 months ago
    #309293
  • 🇮🇹Italy plach Venezia

    Thanks!

  • Issue was unassigned.
  • Status changed to RTBC 4 months ago
  • 🇺🇸United States byrond

    I ran into an issue with a custom module and another contrib module while both tried to decorate the page cache service. Our code was similar to this update, so I'm curious if this has been tested in a similar environment before being marked RTBC. I'm also curious about the status of this issue while tests are failing.

    You could consider testing with Tome to confirm there are no issues with the service decoration:
    https://www.drupal.org/project/tome/issues/3499452 🐛 ResettablePageCache overrides other service decorators Active

    Tome Static has a "ResettablePageCache" that provides a "reset()" method. The code in the PR suggests this additional method could be lost if Big Pipe is the outer service (which seems to be the intent with a decoration priority of -1000). Any other inner service decorators that define new methods would also be affected.

Production build 0.71.5 2024