Skip to content

fix: accept documented LiteSpeed cache-hit headers - #62

Merged
tayfuryldz merged 2 commits into
tayfuryldz:mainfrom
Ymax27:ymax27/litespeed-cache-hit
Oct 2, 2026
Merged

tayfuryldz merged 2 commits into
tayfuryldz:mainfrom
Ymax27:ymax27/litespeed-cache-hit

Conversation

@Ymax27

@Ymax27 Ymax27 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • cache_indicators() records X-LiteSpeed-Cache, X-LSADC-Cache, and X-QC-Cache with their exact values.
  • shared_cache_hit_markers() accepts only an exact hit token for those headers. miss, bypass, mixed values, and substrings such as hitter are not hit evidence.
  • A four-stage cache state machine can satisfy the cache-hit checks from X-LiteSpeed-Cache: hit. The same sequence with miss does not.
  • Existing Age, X-Cache, CF-Cache-Status, Cache-Status, Akamai, and Server-Timing handling is unchanged. The header does not by itself make a response look cacheable.

Scope

Fixes #40.

LiteSpeed documents hit as served from LSCache and miss as not served from cache: https://docs.litespeedtech.com/lscache/start/

The second commit on this branch removes an accidental out-of-band promotion edit so the final diff only changes cache-hit recognition.

Validation

Commands run on this branch:

PYTHONPATH=src python3 -m pytest -q tests/test_litespeed_cache.py

Observed result: 2 passed.

ruff and mypy are not installed in this environment, so those gates were not run. The detector/evidence coverage gate was also not run here.

Checklist

  • CLI changes are safe by default and documented.
  • New detection behavior includes tests.
  • False-positive filtering remains conservative by default.
  • Observations/probes are preserved even when findings are filtered.
  • Evidence schema and proof-gate mutation tests pass.
  • No destructive payloads or denial-of-service behavior were added.
  • I reviewed the final diff and can explain the changes I am submitting.
  • Validation results in this PR are from commands actually run on this branch; no results or evidence were fabricated.
  • Any assumptions I could not verify are stated explicitly instead of being presented as facts.

Made with Cursor

@Ymax27
Ymax27 requested a review from tayfuryldz as a code owner October 2, 2026 10:52

@tayfuryldz tayfuryldz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this against current main and ran the full maintainer gates locally: pytest, Ruff, and mypy are clean. The diff stays within the issue scope and I did not find a blocking regression.

@tayfuryldz
tayfuryldz enabled auto-merge (squash) October 2, 2026 16:56
@tayfuryldz
tayfuryldz force-pushed the ymax27/litespeed-cache-hit branch 4 times, most recently from ff95059 to 78119cb Compare October 2, 2026 17:08
Ymax27 and others added 2 commits October 2, 2026 20:10
Record X-LiteSpeed-Cache, X-LSADC-Cache, and X-QC-Cache, and treat only an exact hit value as shared-cache hit evidence.

Co-authored-by: Cursor <cursoragent@cursor.com>
The first commit on this branch also changed out-of-band promotion. Restore that path so this change only records LiteSpeed hit headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tayfuryldz
tayfuryldz force-pushed the ymax27/litespeed-cache-hit branch from 78119cb to 413b1d4 Compare October 2, 2026 17:10
@tayfuryldz
tayfuryldz merged commit c34ca0b into tayfuryldz:main Oct 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recognize documented LiteSpeed cache-hit evidence

2 participants