Skip to content

feat/cache last modified#2467

Merged
forgetso merged 5 commits intomainfrom
feat/cache-last-modified
Mar 25, 2026
Merged

feat/cache last modified#2467
forgetso merged 5 commits intomainfrom
feat/cache-last-modified

Conversation

@forgetso
Copy link
Copy Markdown
Member

  • Cache based on last modified
  • docs(changeset): Cache based on last modified

Copilot AI review requested due to automatic review settings March 25, 2026 20:13
@forgetso forgetso enabled auto-merge (squash) March 25, 2026 20:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Last-Modified–based validation to the Node-only cacheFile utility, allowing caching/revalidation when ETag is not provided by the server.

Changes:

  • Implement Last-Modified filename encoding/decoding and If-Modified-Since fetch flow as a fallback to ETag.
  • Update cacheFile logic to choose between ETag and Last-Modified revalidation and cache accordingly.
  • Extend unit tests to cover Last-Modified round-tripping and empty-body handling; add a util changeset entry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
packages/util/src/cacheFile.ts Adds Last-Modified fetch/save support and updates cache decision logic (ETag-first, LM fallback).
packages/util/src/tests/cacheFile.unit.test.ts Refactors ETag tests to use sequential mocks; adds new Last-Modified test suite.
.changeset/cute-states-exist.md Publishes a patch changeset describing the new caching behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 25, 2026 20:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@forgetso forgetso merged commit a25dffa into main Mar 25, 2026
9 checks passed
@forgetso forgetso deleted the feat/cache-last-modified branch March 25, 2026 20:46
light-source pushed a commit that referenced this pull request Mar 30, 2026
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.

3 participants