Problem/Motivation
When generating a preview link using WSE (Workspace), the link displays data from the live workspace instead of the intended preview workspace data. This issue occurs specifically when working with Pantheon hosting.
Steps to reproduce
1. Create or modify content in a preview workspace
2. Generate a WSE preview link for the workspace
3. Access the generated preview link
4. Observe that the content shows live workspace data instead of preview workspace data
Proposed resolution
- Implemented Pantheon's cache control documentation: https://docs.pantheon.io/cache-control
- Tried setting NO_CACHE headers
- Attempted Cache-Control header modifications
- Issue persists despite cache-related troubleshooting
Remaining tasks
Create a patch? It looks like Workspace context is not being properly maintained through the preview URL, need to investigate more.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 3544287-15.patch | 26.32 KB | rishi.kulshreshtha |
| #13 | 3544287-12.patch | 25.99 KB | rishi.kulshreshtha |
Issue fork wse-3544287
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
Comment #2
dandaman commentedRishi, it looks like others are having the same issue on other hosts: #3544287: Live workspace data is shown instead of preview workspace
Have you tried applying the changes they have proposed? Does that fix the issue for you?
Comment #3
rishi.kulshreshthaSimilar issues have been reported by an Acquia Cloud user in this https://www.drupal.org/project/wse/issues/3504084 issue. In the same thread, another user on Platform.sh resolved the problem by adding the
wse_previewcookie as described in Platform.sh's cache documentation https://docs.platform.sh/define-routes/cache.htmlHowever, I don't believe this applies in my case, as both the NO_CACHE and
wse_previewcookies are already present during the initial redirect and subsequent requests. Also, the patch provided in that issue did not resolve the problem on my end.I additionally attempted a custom solution to force cache bypass behavior using an EventSubscriber that sets the following:
Unfortunately, none of these approaches has worked so far.
Comment #5
rishi.kulshreshthaBecause of the way the cookie is named, this module isn't compatible with the Pantheon.io hosting platform. However, according to Pantheon's technical documentation, this can be easily fixed by choosing a cookie name that their system supports.
Comment #11
shasha821110 commented#9 works as expected in my testing. For Drupal 10 environments, apply the following patch after step #9.
Comment #12
rishi.kulshreshthaComment #13
rishi.kulshreshthaAll tests have successfully passed. Details can be found at: https://git.drupalcode.org/issue/wse-3544287/-/pipelines/760657. This is now ready for review. Attached is the patch for use.
Comment #15
rishi.kulshreshthaThis patch is compatible with the 2.x release (Drupal 10 compatible).
Comment #16
amateescu commentedWSE Preview has been promoted to a standalone project.
Comment #17
chrisfromredfinConfirming that this 10.x port works for us. We'll move to using workspace_preview with patch there.
Comment #18
amateescu commentedI've added preview auth providers in #3592750: Add pluggable preview authorization providers with CDN caching support, including one for Pantheon that I've been testing on their free tier. I'd appreciate any feedback whether it works correctly :)