Skip to content

Avoid duplicate OBJ model loads from cachebust_origin#874

Open
Gimyoonsoo wants to merge 3 commits into
tscircuit:mainfrom
Gimyoonsoo:algora-93-model-cache
Open

Avoid duplicate OBJ model loads from cachebust_origin#874
Gimyoonsoo wants to merge 3 commits into
tscircuit:mainfrom
Gimyoonsoo:algora-93-model-cache

Conversation

@Gimyoonsoo
Copy link
Copy Markdown

@Gimyoonsoo Gimyoonsoo commented May 12, 2026

Summary

  • Fixes or improves the duplicate OBJ model loading behavior described in Improve 3d model loading to avoid laggy browser #93.
  • Keeps the change focused on cache-key normalization so equivalent cache-busted model URLs reuse parsed OBJ results without conflating distinct hosts.

Changes

  • Normalize OBJ loader cache keys by removing volatile cachebust and cachebust_origin query parameters.
  • Keep fetching the original model URL while allowing equivalent model URLs to reuse the cached parsed object.
  • Preserve host identity for absolute and protocol-relative URLs, so //cdn-a.example.com/... and //cdn-b.example.com/... do not collide.
  • Keep relative model URLs relative when generating cache keys.
  • Add regression coverage for absolute, relative, cache-busted, and protocol-relative model URLs.

Review follow-up

  • Addressed the automated review about protocol-relative URL host collisions in the latest branch state.
  • The regression coverage now explicitly checks separate protocol-relative hosts.

Testing

  • GitHub PR metadata on latest commit 1f05a57: mergeable: true.
  • Vercel preview for the latest commit is Ready.
  • ..\tools\bun\bun-windows-x64\bun.exe --config ./bunfig.test-no-preload.toml test tests\global-obj-loader-cache-key.test.ts
  • Result: passed locally with an uncommitted temporary config that disables the repo preload.
  • ..\tools\bun\bun-windows-x64\bun.exe test tests\global-obj-loader-cache-key.test.ts
  • Result: failed before running the test body because this local Windows checkout is missing sharp-win32-x64.node required by the default test preload.
  • ..\tools\bun\bun-windows-x64\bun.exe x tsc --noEmit
  • Result: passed locally.
  • ..\tools\bun\bun-windows-x64\bun.exe x biome lint src\hooks\use-global-obj-loader.ts tests\global-obj-loader-cache-key.test.ts
  • Result: passed locally.
  • ..\tools\bun\bun-windows-x64\bun.exe run build
  • Result: passed locally.
  • git diff --check
  • Result: passed locally.

Notes

  • No authentication, payment, database, deployment, or security-sensitive configuration changes were made.
  • No secrets, credentials, production data, or security-sensitive information were accessed.

Algora

/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 4:46pm

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: ccfc57dd7e

ℹ️ 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 thread src/hooks/use-global-obj-loader.ts Outdated
@Gimyoonsoo
Copy link
Copy Markdown
Author

Pushed a follow-up commit that also normalizes the cachebust query parameter, with focused cache-key coverage for both cachebust and cachebust_origin.

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