Add cache_context.main_request to force execution of the main route

Created on 27 February 2015, over 10 years ago
Updated 16 May 2025, 18 days ago

Problem/Motivation

There are blocks like views_exposed filters that rely on the main request, but there is no way to specify that.

Panels and SCOTCH would like a render pipeline, where even the main content is created with #pre_render(_cache) and things are independent of another.

This is not possible currently and the main request always needs to be executed.

This however is different now that with SmartCache we could have per route caching and is also an important step for placeholder-ing.

Proposed resolution

- Introduce cache_context.main_request
- Ensure that if something has set this cache_context, when getting this item from cache, that the main request is executed.

Remaining tasks

- Implement the cache context
- Add the necessary logic.

User interface changes

API changes

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

cache system

Created by

πŸ‡©πŸ‡ͺGermany Fabianx

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

  • API addition

    Enhances an existing API or introduces a new subsystem. Depending on the size and impact, possibly backportable to earlier major versions.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024