Problem/Motivation

#3628886 made the inbox page cacheable: its task table varies by user, so it is now a placeholder, and the page around it gets a Dynamic Page Cache HIT. Several other orchestra pages have the same problem. Each declares the user context, or max-age: 0, on content placed straight into the page, so the Dynamic Page Cache refuses the whole page and every visit rebuilds it.

Measured on a site with orchestra 1.x (two consecutive visits each), all UNCACHEABLE (poor cacheability) at about 0.7 s, where the inbox now answers a HIT in about 0.3 s:

  • /orchestra/actions: OperationController, user + orchestra_tenant, max-age: 0
  • /orchestra/requests: RequestsController, user + url.query_args:status, max-age: 0
  • /orchestra/instance/{orchestra_instance}: InstanceReadController, user, max-age: 0
  • /admin/orchestra/instances: InstanceListForm, user, max-age: 0
  • /admin/orchestra/instances/{orchestra_instance}: OrchestraUiController::instance(), max-age: 0

Refused by the same rule, from what they declare (orchestra_delegation was not enabled on that site):

  • /orchestra/delegations, /orchestra/delegations/covering, /admin/orchestra/delegations: DelegationsController, user + orchestra_tenant

Proposed resolution

For each page, first check whether it really needs user and max-age: 0. Some may only need user.permissions or a finite max-age, and then the page is cacheable as it is. What really is per user moves into a placeholder, as on the inbox: a child of the page array (not the page array itself, which the page renderer adds properties to), whose lazy builder reads the request itself rather than taking request values as arguments.

Convert a page only where the shared part is worth caching: a placeholder that stays max-age: 0 is still rebuilt on every request.

Outcome, after checking each page: the actions page, the requests page and the two personal delegation pages are converted to placeholders, with their cacheability unchanged. The read page (/orchestra/instance/{orchestra_instance}) cannot be: its access check varies by user by design, and core adds a route's access cacheability to the response. The admin pages (/admin/orchestra/instances, an instance's trace, /admin/orchestra/delegations) cannot be either: core's DenyAdminRoutes policy never lets the Dynamic Page Cache store an admin route.

Remaining tasks

  • Decide per page: narrow the cacheability, use a placeholder, or leave it.
  • For each converted page, a kernel test that sends a real request through http_kernel, and a functional test asserting the Dynamic Page Cache HIT.

User interface changes

None.

API changes

None expected.

Data model changes

None.

AI-Generated: Yes (Claude Code was used to help draft this issue summary and to measure the pages. I reviewed it.)

Issue fork orchestra-3628892

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Issue summary: View changes

mably’s picture

Issue summary: View changes
mably’s picture

Status: Active » Needs review

  • mably committed 275014b4 on 1.x
    task: #3628892 Let the Dynamic Page Cache store the other orchestra...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.