[blob] feat: add useCache option to bypass CDN cache#954
Merged
vvo merged 6 commits intoblob/privatefrom Jan 29, 2026
Merged
Conversation
Add a `useCache` option to `blob.get()` that controls whether to use the content-cache layer: - `useCache: true` (default) = normal caching behavior - `useCache: false` = appends ?cache=0 to bypass cache Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
vvo
commented
Jan 28, 2026
vvo
added a commit
that referenced
this pull request
Feb 19, 2026
* [blob] add private blobs * browser * changeset * bypass * latest * main * remove live tests * multi part tests * add get by blob * update blob with streams * add access type * allow download urls and simplify typing * update * update * feat(blob): add raw headers to get() response Add headers property to GetBlobResult interface, returning the raw Headers object from the fetch response for accessing additional metadata like ETag or x-vercel-* headers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(blob): add optional headers option to get() Allow passing additional headers to the fetch request via an optional headers option. Documented as an advanced feature since most users won't need it. The authorization header is always set automatically. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * ensure createFolder requires access property now, it's a write like put * [blob] feat: add useCache option to bypass CDN cache (#954) * [blob] feat: add useCache option to bypass content-cache Add a `useCache` option to `blob.get()` that controls whether to use the content-cache layer: - `useCache: true` (default) = normal caching behavior - `useCache: false` = appends ?cache=0 to bypass cache Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: clarify useCache only works for private blobs * Apply suggestion from @vvo * docs: use opaque terminology for cache (edge cache vs origin storage) * docs: use CDN cache terminology --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> * add tests for private, fix method * update * update * fix(blob): add etag to get() response Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * update * update * update ts docs * conditional gets * add conditional reads * changeset * update --------- Co-authored-by: Shawn Feldman <shawn.feldman@vercel.com> Co-authored-by: Vincent Voyer <vincent@codeagain.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
Adds a
useCacheoption toblob.get()that controls whether to fetch from CDN cache or directly from origin storage:useCache: true(default) - allows blob to be served from CDN cacheuseCache: false- fetches directly from origin storageNote: Only effective for private blobs. Public blobs always use CDN cache.
Why
This is useful when you need the latest version of a blob immediately after an update, bypassing any cached responses.
Usage
Test plan
useCache: falseappending?cache=0useCache: trueand omitted not appending query paramdownloadUrldoesn't includecache=0🤖 Generated with Claude Code