- Issue created by @djdevin
- π³πΏNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies β .
An anonymous request with a Workspace activated by a cookie negotiator results in an uncacheable response.
1. Install Drupal 11
2. Enable Workspaces and workspaces_ui
3. Enable this module https://git.drupalcode.org/sandbox/devin-3509741
4. Grant "view any workspace" to Anonymous users
5. Create a page in the live workspace
6. Edit the page in the stage workspace
7. Make requests:
curl -H "Cookie: devin=yes" -k https://drupal11.lndo.site/node/1 -o /dev/null -vvv
This returns: < x-drupal-dynamic-cache: UNCACHEABLE (poor cacheability)
curl -k https://drupal11.lndo.site/node/1 -o /dev/null -vvv
This returns: < x-drupal-dynamic-cache: HIT
In \Drupal\workspaces\EntityAccess:
The cachePerUser() in bypassAccessResult() is the issue, removing it allows the response to be cached correctly.
Not sure what the proper solution is but removing that allowed anonymous requests to be cached and activate the correct workspace based on a cookie.
Active
11.1 π₯
workspaces.module
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies β .