Skip to content

fix(proxy): hash upstream cache keys#835

Open
harlan-zw wants to merge 1 commit into
mainfrom
fix/hash-upstream-cache-keys
Open

fix(proxy): hash upstream cache keys#835
harlan-zw wants to merge 1 commit into
mainfrom
fix/hash-upstream-cache-keys

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

No linked issue.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Nitro writes custom defineCachedFunction keys directly into unstorage paths. The embed and proxy handlers passed full upstream URLs, so reserved URL characters could produce invalid keys on stricter storage drivers.

Hash normalized JSON, binary, and Instagram embed cache keys before storage. Binary keys now also vary on ignoreResponseError.

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
scripts-playground Ready Ready Preview, Comment Jul 20, 2026 3:49pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 08ca3cd9-0a67-4de1-b940-a3c97851be91

📥 Commits

Reviewing files that changed from the base of the PR and between 343573d and 6ad0cd7.

📒 Files selected for processing (3)
  • packages/script/src/runtime/server/instagram-embed.ts
  • packages/script/src/runtime/server/utils/cached-upstream.ts
  • test/unit/cached-upstream.test.ts

📝 Walkthrough

Walkthrough

Cache key generation for binary, JSON/text, and Instagram embed upstream requests now hashes normalized URLs, options, headers, or composite key parts before Nitro storage. Binary keys also vary on ignoreResponseError. New unit tests capture cache definitions and verify normalization, deterministic option ordering, reserved URL characters, and Instagram embed header composition.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes hashing upstream cache keys for proxy and embed caching.
Description check ✅ Passed The description matches the changes and explains the cache-key hashing fix and the new ignoreResponseError variation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hash-upstream-cache-keys

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@835

commit: 6ad0cd7

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