-
Notifications
You must be signed in to change notification settings - Fork 106
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
Trustless gateway broker should use subdomain gateway to prevent 301 roundtrips #347
Comments
I think we should use attempt to use subdomain gateways, and convert any cidv0 to v1 |
One thing to consider is that not all gateways support subdomain resolution. If we only support subdomain gateways we're limiting users because they are less common. If we support both, it comes with the added complexity (which seems fine). I realise that subdomain resolution is important for origin isolation, but only relevant for loading sites directly from the trustless gateway. |
* fix: use path gateway to avoid redirects fixes #347 * Update packages/block-brokers/src/trustless-gateway/index.ts Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> --------- Co-authored-by: Daniel N <2color@users.noreply.github.com> Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>
Background
The current Trustless gateway broker uses path resolution by default and has 4 subdomain gateways defined in the defaults. This leads to it getting 301s for most requests because subdomain gateways redirect from path requests to the subdomain. For example:
Since 301s are permanent, the browser will cache these after the initial request, however, this results in an additional round trip per CID.
helia/packages/helia/src/block-brokers/trustless-gateway/trustless-gateway.ts
Lines 48 to 53 in 299bb09
Suggested solutions
The text was updated successfully, but these errors were encountered: