fix(shared-ols): never cache logged-in pages (disable tier private cache) #20
Reference in New Issue
Block a user
Delete Branch "fix/shared-ols-no-logged-in-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The shared-OLS tier set
enablePrivateCache 1+checkPrivateCache 1at module scope, on the assumption (per the old comment) that "no plugin → nothing cached." That proved false in production: with private storage +reqCookieCacheon, OLS privately cached logged-in / cookie-bearing responses regardless of whether the LiteSpeed Cache WP plugin was present.Observed on a customer site: after a leftover
.maintenanceflag was removed, WordPress's "An automated WordPress update has failed to complete" admin nag kept showing — OLS was serving the logged-in wp-admin page from private cache for the fullprivateExpireInSeconds(3600s) TTL. WordPress itself was clean.Fix
Disable private caching at the tier:
enablePrivateCache 1 → 0checkPrivateCache 1 → 0Logged-in / cookie-bearing pages are now always served fresh. Public/anonymous caching is unchanged (
enableCache 1+checkPublicCache 1), still honored from the plugin'sX-LiteSpeed-Cache-Controlheaders. Comment rewritten to document the corrected behavior and the failure it prevents.Scope / rollout
configs/shared-ols/httpd_config_base.tpl(rendered into each shared-OLS container'shttpd_config.confat startup).trunktriggers the image build; rolling deploy picks it up. Eachshared-olscontainer applies it on its next render/restart.Branched off clean
trunk— does not touch the in-progress shared-ols/lsphp refactor in the working tree.