Normalize cachebust_origin in OBJ loader cache keys#878
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 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".
| .replace(/([?&])cachebust_origin=[^&#]*(&)?/g, (_match, separator, hasMore) => | ||
| separator === "?" && hasMore ? "?" : hasMore ? "&" : "", |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
normalizeModelCacheUrlhelper to stripcachebust_originquery params robustlyuseGlobalObjLoaderThis addresses duplicate cache entries and repeated model loads caused by cachebust variants of the same model URL.
Validation
bunis not installed./claim #93