⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@ihoffmann-dot
Copy link
Contributor

@ihoffmann-dot ihoffmann-dot commented Feb 4, 2026

Summary

Added a condition to the /render flow (LIVE mode only, BE users only) to avoid caching in Published mode.

Changes

  • Added a condition in VelocityUtil.shouldPageCache to bypass the cache when the PageMode is LIVE and the logged-in user is a BE user
  • Implemented the remove method in StaticPageCacheImpl

Motivation

The issue addressed by this PR is caused by the way cache keys are generated for pages displayed in LIVE mode. We decided to completely disable caching when logged in as a BE user and the PageMode is LIVE.

This issue only occurs in the Published view when using Traditional dotCMS. As a result, incorrect information can be displayed, leading to inconsistencies between LIVE mode and the actual page.

Related Issue

Fixes [DEFECT] Browser displays unpublished version of pages, not respecting Live mode #34405

@nollymar nollymar requested a review from wezell February 4, 2026 22:54
@ihoffmann-dot ihoffmann-dot changed the title fix(Cache): Added subkey to page cache to include contentlet information (Live mode only) + Clean up cache logic fix(Cache): Added flag on /render flow (Live mode only) to avoid cache in Published mode Feb 9, 2026
Copy link
Contributor

@fabrizzio-dotCMS fabrizzio-dotCMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems too aggressive, suppressing all caching for live requests. Perhaps testing if the user is an admin is in order

Copy link
Contributor

@wezell wezell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good, glad we finally got there. Should have a test

@ihoffmann-dot ihoffmann-dot changed the title fix(Cache): Added flag on /render flow (Live mode only) to avoid cache in Published mode fix(Cache): Added condition on /render flow (Live mode only) to avoid cache in Published mode Feb 10, 2026
Copy link
Contributor

@wezell wezell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comments

@nollymar nollymar disabled auto-merge February 10, 2026 17:53
Copy link
Contributor

@wezell wezell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good after null checks - sorry that was a pain!

@wezell wezell enabled auto-merge February 10, 2026 19:43
@wezell wezell added this pull request to the merge queue Feb 10, 2026
Merged via the queue into main with commit 7bd898e Feb 11, 2026
38 checks passed
@wezell wezell deleted the issue-34405 branch February 11, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[DEFECT] Browser displays unpublished version of pages, not respecting Live mode

5 participants