Skip to content

Normalize cachebust_origin in OBJ loader cache keys#878

Open
JYZ-LESLIE wants to merge 1 commit into
tscircuit:mainfrom
JYZ-LESLIE:codex/normalize-cachebust-origin-model-cache-key
Open

Normalize cachebust_origin in OBJ loader cache keys#878
JYZ-LESLIE wants to merge 1 commit into
tscircuit:mainfrom
JYZ-LESLIE:codex/normalize-cachebust-origin-model-cache-key

Conversation

@JYZ-LESLIE
Copy link
Copy Markdown

Summary

  • add normalizeModelCacheUrl helper to strip cachebust_origin query params robustly
  • use normalized URL as the cache key in useGlobalObjLoader
  • add focused regression tests for different cachebust query shapes

This addresses duplicate cache entries and repeated model loads caused by cachebust variants of the same model URL.

Validation

  • Could not run tests in this environment because bun is not installed.

/claim #93

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

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

Project Deployment Actions Updated (UTC)
3d-viewer Ready Ready Preview, Comment May 12, 2026 1:30pm

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44c4b9d3d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3 to +4
.replace(/([?&])cachebust_origin=[^&#]*(&)?/g, (_match, separator, hasMore) =>
separator === "?" && hasMore ? "?" : hasMore ? "&" : "",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Strip repeated cachebust_origin params completely

The new normalizer only removes the first cachebust_origin when the parameter appears multiple times, because the regex optionally consumes the following & and the next occurrence is no longer preceded by ? or &. For example, ...?cachebust_origin=a&cachebust_origin=b&pn=C1 normalizes to a URL that still contains one cachebust_origin, so equivalent cache-busted URLs can still produce different cache keys and duplicate OBJ cache entries.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant