Let the Dynamic Page Cache store the other orchestra pages that vary per user

Closes https://www.drupal.org/project/orchestra/issues/3628892

Same treatment as the inbox in #3628886: the per-user content moves into a placeholder, a child of the page array, with exactly the cacheability it had (the actions and requests lists keep max-age: 0, the delegation listings their user and tenant contexts and dated max-age). Nothing becomes staler; the page around the content (theme, blocks, menus) is now cached by the Dynamic Page Cache instead of being rebuilt on every visit.

Converted:

  • /orchestra/actions: OperationController::buildActionsPage() places buildActionsTable().
  • /orchestra/requests: RequestsController::buildRequestsPage() places buildRequestsList(), which calls the unchanged page() with the current request. The status filter and each card's return target come from the query string, which the cached page (keyed by route) does not vary by, so the list reads the request itself (new RequestStack constructor argument).
  • /orchestra/delegations and /orchestra/delegations/covering: DelegationsController::buildDelegatedByMePage() / buildDelegatedToMePage() place buildDelegatedByMeList() / buildDelegatedToMeList() (formerly mine() / covering(); the tenant-wide all() is now buildTenantDelegationsPage(), still unwrapped). The Add button stays inside, because its destination is the current URL.

Not converted, and why:

  • /orchestra/instance/{id} (read page): its access check (InstanceReadAccessCheck) varies by user by design (whether this person may read this run), and core adds a route's access cacheability to the response, so the page cannot be cached whatever its content does.
  • /admin/orchestra/instances, /admin/orchestra/instances/{id}, /admin/orchestra/delegations: admin routes, which core's DenyAdminRoutes policy never lets the Dynamic Page Cache store.

Measured on Imax (local copy, both pages had answered UNCACHEABLE (poor cacheability) at about 0.7–0.8 s): /orchestra/actions now a HIT at about 0.31 s, /orchestra/requests a HIT at about 0.39–0.43 s (the list itself is still built per request).

Tests:

  • PageCacheTest (orchestra_ui, functional): actions and requests pages answer MISS then HIT; a second operator with the same role, on the same cached page, sees only their own content; the requests cards return to the current query string, not the one the cached page was built for. Fails on 1.x with UNCACHEABLE (poor cacheability).
  • DelegationPageCacheTest (orchestra_delegation, functional): the same for both delegation pages; moving the Add button out of the placeholder fails it (a link still carries the first request's query string).
  • PendingActionsFinderTest calls buildActionsTable(). DelegationAccessTest, RequestsControllerTest, DelegationUiTest and RequesterDetailTest pass unchanged.
Edited by Frank Mably

Merge request reports

Loading
Loading