fix(cache): document Serve Stale as async revalidation#1001
Open
faisalahammad wants to merge 1 commit into
Open
fix(cache): document Serve Stale as async revalidation#1001faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
The Serve Stale option (purge-stale) already tells the LiteSpeed web server to revalidate in the background by emitting a stale, token in the X-LiteSpeed-Purge header. Same semantics as Cloudflare async revalidation, but the option was hard to find. Reword the admin description to use the async revalidation and stale-while-revalidate terminology. Sync the default in data/const.default.json from empty string to 0 so it matches the PHP boolean default. Add a bullet under the LiteSpeed Exclusive Features section of readme.txt pointing at the existing docs page. No behavior change. No new option. Off by default stays off by default. Fixes litespeedtech#994
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
The Serve Stale option (
purge-stale) already tells the LiteSpeed web server to revalidate in the background by emitting astale,token in theX-LiteSpeed-Purgeheader. Same semantics as Cloudflare async revalidation, but the option was hard to find from the admin UI or the plugin readme.This PR rewrites the admin description to use the async revalidation and stale-while-revalidate terminology, syncs the
data/const.default.jsondefault with the PHP default, and adds a discoverable bullet to the readme.Fixes #994
Changes
tpl/cache/settings-purge.tpl.php
Before:
After:
Why: Users searching for the same words used in Cloudflare docs and in issue #994 (asynchronous revalidation, stale-while-revalidate) can now find the option that already does exactly that.
data/const.default.json
Before:
"purge-stale": ""After:
"purge-stale": "0"Why: Empty string did not match the boolean
falsedefault insrc/base.cls.php. Other boolean entries in this file use"0"(e.g.purge-upgrade). Syncs the two default sources.readme.txt
Added one bullet under the "LiteSpeed Exclusive Features" section:
Why: The Serve Stale option was not mentioned on the plugin page at all. Adds discoverability for users who read the readme before opening the admin UI.
Testing
Test 1: Admin description shows the new terminology
litespeed-cache-994.zipon a WordPress test site.Result: Works as expected.
Test 2: Default value in DB option is now
0wp option get purge-stalefrom WP-CLI.0(was empty string before this PR).Result: Works as expected.
Test 3: Readme bullet visible on the plugin page
Result: Works as expected.
Test 4: PHPCS clean on the changed files
composer installto pull the dev dependencies.composer sniff-checkruns PHPCS over the whole plugin.src/cdn/cloudflare.cls.php) are pre-existing and unrelated to this PR. Confirmed by re-running the lint on a stashed working tree.Result: No new violations introduced.
Test 5: CodeRabbit CLI review on the diff
coderabbit review --agent