Skip to content

[@vercel/blob] Deprecate useCache option on get() to a no-op#1075

Open
falcoagustin wants to merge 1 commit into
mainfrom
falcoagustin/blob-deprecate-use-cache
Open

[@vercel/blob] Deprecate useCache option on get() to a no-op#1075
falcoagustin wants to merge 1 commit into
mainfrom
falcoagustin/blob-deprecate-use-cache

Conversation

@falcoagustin

Copy link
Copy Markdown
Collaborator

Problem

The useCache option on get() worked by appending a cache=0 query parameter to the fetch URL when set to false, instructing the backend to bypass the CDN cache and read directly from origin storage. The backend no longer supports this — cache=0 is now ignored — so the option silently does nothing.

It shipped in @vercel/blob@2.4.0 as part of the beta private-storage feature.

Solution

Make useCache a no-op:

  • Remove the cache=0 URL-construction logic; get() always fetches the plain blob URL through the standard caching path.
  • Keep the useCache?: boolean field on GetCommandOptions but mark it @deprecated, so existing callers still compile rather than hitting a type error. It can be removed in a future major version.
  • Remove the tests that asserted the old cache=0 behavior.

minor changeset (deprecation, not a breaking removal). Type-check and the 156 node tests pass.

🤖 Generated with Claude Code

The backend no longer honors the cache=0 query parameter that useCache: false
produced, so the option had no effect. Gut the implementation (reads always go
through the standard caching path) and remove its tests. The typed option is
kept and marked @deprecated so existing callers compile without error; it will
be removed in a future major version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9dea88e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vercel/blob Minor
vercel-storage-integration-test-suite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vercel-storage-next-integration-test-suite Ready Ready Preview Jun 24, 2026 1:57pm

Request Review

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.

1 participant