Repository navigation
Keep mismatched Accept headers out of the LiteSpeed cache - #3969
Merged
Merged
Conversation
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.
Fixes #
Proposed changes:
Accept, while the plugin picks the representation by quality (accept_prefers_activitypub()). For headers where the two disagree, a response could be cached in the other representation's bucket.Litespeed_Cache::maybe_disable_cache()runs ontemplate_redirectwhen LiteSpeed Cache is active and callslitespeed_control_set_nocachewhen the rule and the plugin disagree. Requests where both agree stay cacheable as before.ACCEPT_PATTERNconstant, used by the rule and by the check. The rule text is unchanged, so existing.htaccessfiles are not rewritten.Other information:
I did not widen the rewrite rule, because a
RewriteCondcannot rank by quality, and a broader rule would mix the buckets again (see #3596 and #3601).Testing instructions:
vendor/bin/phpunit --filter Test_Litespeed_CacheAccept: text/html;q=0.1, application/activity+jsonand check that the response hasX-LiteSpeed-Cache-Control: no-cache, and that a normal browser request still gets the cached HTML.Changelog entry
Changelog Entry Details
Significance
Type
Message