storacha-network / w3infra

🏗️ Infra for the w3up UCAN protocol implementation
Other
15 stars 5 forks source link

fix: roundabout should just redirect to 404 presigned url when no car in bucket instead of redundant check #332

Closed vasco-santos closed 6 months ago

vasco-santos commented 6 months ago

@ribasushi did some profiling and roundabout is taking ~800ms just to return the 302 status code (when requesting bytes by PieceCID). Probably most of this time comes from waiting on the content claims response, but also looking into what else Roundabout handler does, it may be a good idea to just redirect to the presigned url without validating content is in the bucket. We save one request to the bucket, and given we only use roundabout in internal cases it should never be 404. But actually if it is 404, might make more sense to then have presigned url response to be 404 than server to throw an error.

Thoughts?

seed-deploy[bot] commented 6 months ago
View stack outputs - **pr332-w3infra-BillingDbStack** Name | Value -- | -- customerTableName | pr332-w3infra-customer spaceDiffTableName | pr332-w3infra-space-diff spaceSnapshotTableName | pr332-w3infra-space-snapshot usageTable | pr332-w3infra-usage - **pr332-w3infra-BillingStack** Name | Value -- | -- ApiEndpoint | https://z71yo6i23a.execute-api.us-east-2.amazonaws.com billingCronHandlerURL | https://sti3t2q7btk5je3bc7dxmgeigq0ejnke.lambda-url.us-east-2.on.aws/ CustomDomain | https://pr332.billing.web3.storage - **pr332-w3infra-CarparkStack** Name | Value -- | -- BucketName | carpark-pr332-0 Region | us-east-2 - **pr332-w3infra-RoundaboutStack** Name | Value -- | -- ApiEndpoint | https://jg8xbdcntd.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr332.roundabout.web3.storage - **pr332-w3infra-SatnavStack** Name | Value -- | -- BucketName | satnav-pr332-0 Region | us-east-2 - **pr332-w3infra-UploadApiStack** Name | Value -- | -- ApiEndpoint | https://oeclzd7ra3.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr332.up.web3.storage - **pr332-w3infra-BusStack** - **pr332-w3infra-FilecoinStack** - **pr332-w3infra-ReplicatorStack** - **pr332-w3infra-UcanFirehoseStack** - **pr332-w3infra-UcanInvocationStack** - **pr332-w3infra-UploadDbStack**