Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Local IPFS Gateway with Model Viewer #63

Open
codynhat opened this issue Dec 29, 2022 · 1 comment
Open

Use Local IPFS Gateway with Model Viewer #63

codynhat opened this issue Dec 29, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@codynhat
Copy link
Member

The browser will currently always download assets for Model Viewer from some configurable IPFS gateway. This is because Model Viewer needs to be given a src attribute with the location of the GLB file.

There are cases when loading an asset from a local IPFS node would be better. This may be a better route than using a public gateway if the asset is already stored locally. This could either be done:

  1. js-ipfs node is running in browser and has the content. Can be fetched via a service worker running a gateway. See https://github.com/ipfs-examples/js-ipfs-browser-service-worker
  2. Some other local IPFS node (Brave, IPFS Desktop, etc) has the content and is running a gateway. This is when ipfs-provider is using an HTTP client

The browser also appears to cache assets using normal HTTP caching. So it is unclear how much benefit this approach would really have.

@codynhat codynhat added the enhancement New feature or request label Dec 29, 2022
@codynhat
Copy link
Member Author

Using Helia is now probably the best choice https://github.com/ipfs-shipyard/helia-service-worker-gateway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant