Skip to content

fix(cache): refetch when 304 adds vary fields - #5732

Open
mcollina wants to merge 1 commit into
mainfrom
fix/cache-304-vary-revalidation
Open

fix(cache): refetch when 304 adds vary fields#5732
mcollina wants to merge 1 commit into
mainfrom
fix/cache-304-vary-revalidation

Conversation

@mcollina

Copy link
Copy Markdown
Member

This relates to...

N/A

Rationale

Foreground 304 Not Modified revalidation bypasses CacheHandler's metadata update path. If that response introduces a valid Vary field that is absent from the stored entry, the cached variant metadata remains incomplete.

Changes

Features

N/A

Bug Fixes

  • Detect newly introduced Vary request-header fields during synchronous revalidation.
  • Evict the stale entry and refetch through CacheHandler so the replacement is stored with complete variant metadata.
  • Add regression coverage for synchronous and asynchronous cache stores.

Breaking Changes and Deprecations

N/A

Status

  • I have read and agreed to the Developer's Certificate of Origin
  • Tested
  • Benchmarked (optional)
  • Documented (no documentation changes needed)
  • Review ready
  • In review
  • Merge ready

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.46%. Comparing base (fc3450d) to head (ee8bebb).

Files with missing lines Patch % Lines
lib/interceptor/cache.js 94.28% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5732      +/-   ##
==========================================
- Coverage   93.47%   93.46%   -0.01%     
==========================================
  Files         110      110              
  Lines       38908    38942      +34     
==========================================
+ Hits        36368    36397      +29     
- Misses       2540     2545       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants