Conversation
Member
forgetso
commented
Mar 25, 2026
- Stream large files
- docs(changeset): Stream large files to avoid loading entire file into RAM
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the @prosopo/util caching utilities to stream remote file downloads to disk (instead of buffering the entire response in memory), improving memory usage when working with large files.
Changes:
- Change
fetchWithETagto return aReadableStream(plus optionalcontentLength) instead of a full string payload. - Update
cacheFile/saveFileWithETagto write fetched content to disk via streaming. - Update unit tests and add a changeset entry documenting the streaming change.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| packages/util/src/tests/cacheFile.unit.test.ts | Updates tests to mock streamed content instead of string content. |
| packages/util/src/fetchWithEtag.ts | Returns a response body stream (and parses content-length) instead of response.text(). |
| packages/util/src/cacheFile.ts | Streams writes to the cache file and makes saveFileWithETag async. |
| .changeset/better-maps-sin.md | Adds a changeset entry for the util package release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.