fix(guest): prevent vary cookie mismatch under scoped debug log - #1034
Open
faisalahammad wants to merge 1 commit into
Open
faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
- Export debug options to .litespeed_conf.dat for Guest Mode - Evaluate client IP and URI scoping in lib/guest.cls.php - Determine vary hashing from client debug eligibility in Vary class - Align guest crawler factor vary hashing with debug scoping rules Fixes litespeedtech#1026
faisalahammad
force-pushed
the
fix/1026-guest-mode-vary-debug-includes
branch
from
August 8, 2026 11:42
17f8a59 to
d9633e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a Guest Mode cache miss issue where the guest vary cookie value diverges between
guest.vary.phpand WordPress core rendering when Debug Log is active with URI includes/excludes or Admin IP restrictions. The vary calculation now evaluates client debug eligibility and URI scoping consistently across both execution contexts.Fixes #1026
Changes
Configuration Persistence (
src/activation.cls.php)Before:
After:
Why: Ensures
lib/guest.cls.phpcan access the active debug configuration from.litespeed_conf.datwhen Object Cache is disabled.Standalone Guest Handler (
lib/guest.cls.php)Before:
After:
Why: Prevents
guest.vary.phpfrom emitting an unhashed cookie when debug logging is restricted to specific URIs or non-matching client IPs.Core Vary Engine (
src/vary.cls.php)Before:
After:
Why: Keeps the domain-wide vary cookie hashed consistently across all pages when URI scoping is enabled.
Crawler Factors (
src/crawler.cls.php)Before:
After:
Why: Aligns guest mode crawler factor vary hashing with the updated vary debug rules.
Testing
Test 1: Guest Mode ON + Debug Log ON + Debug URI Includes set
rest_route=/litespeed).guest.vary.phpand verify the cookie header value./with the returned cookie header.Result: Response returns
x-litespeed-cache: hiton reload with no cookie overwrite.