-
Notifications
You must be signed in to change notification settings - Fork 480
fix(Cache): Added condition on /render flow (Live mode only) to avoid cache in Published mode #34507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ion (Live mode only) + Clean up cache logic
dotCMS/src/main/java/com/dotmarketing/factories/PublishFactory.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/rendering/velocity/servlet/VelocityLiveMode.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/rendering/velocity/servlet/VelocityLiveMode.java
Show resolved
Hide resolved
…e in Published mode + Removed previous code
...m/dotmarketing/portlets/htmlpageasset/business/render/page/HTMLPageAssetRenderedBuilder.java
Outdated
Show resolved
Hide resolved
fabrizzio-dotCMS
left a comment
There was a problem hiding this 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
…k if User is ADMIN and PageMode is LIVE
...m/dotmarketing/portlets/htmlpageasset/business/render/page/HTMLPageAssetRenderedBuilder.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/rendering/velocity/servlet/VelocityLiveMode.java
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/rendering/velocity/util/VelocityUtil.java
Outdated
Show resolved
Hide resolved
wezell
left a comment
There was a problem hiding this 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
wezell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my comments
dotCMS/src/main/java/com/dotmarketing/business/StaticPageCacheImpl.java
Outdated
Show resolved
Hide resolved
wezell
left a comment
There was a problem hiding this 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!
Summary
Added a condition to the
/renderflow (LIVE mode only, BE users only) to avoid caching in Published mode.Changes
VelocityUtil.shouldPageCacheto bypass the cache when thePageModeisLIVEand the logged-in user is a BE userremovemethod inStaticPageCacheImplMotivation
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
PageModeisLIVE.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