Views pages have weird caching behavior

Created on 20 April 2025, 28 days ago

Problem/Motivation

Steps to reproduce

Create a page with a view, e.g. register it at path /foo
Open /foo - it will render, but somehow with content_format = markup.
Open /ce-api/foo - it has the markup cached and renders with markup!

When after a cache clear /ce-api/foo is opened first, all is working fine.

Proposed resolution

Fix cache context.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇦🇹Austria fago Vienna

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

Comments & Activities

  • Issue created by @fago
  • 🇦🇹Austria fago Vienna

    This is at least major. This has the potential to confuse people + might break actual sites.

  • 🇦🇹Austria fago Vienna

    ok, I finally tracked the problem down due to how cache-contexts are calculated.

    Lupus CE renderer correctly adds this cache contexts:
    'url.query_args:_content_format',
    'url.query_args:_select',

    But the problem is the _content_format is actually not changed via the query parameter, but lupus_decoupled_ce_api actually changes it via the request attribute. That means, lupus_ce_renderer should expose this is a new cache context which works like getContentFormatFromRequest().,
    > $default_content_format = $request->attributes->get('lupus_ce_renderer.content_format', $content_format_settings);

  • 🇸🇮Slovenia useernamee Ljubljana
Production build 0.71.5 2024