generated from ipfs/ipfs-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 150
Closed
Labels
P1High: Likely tackled by core team if no one steps upHigh: Likely tackled by core team if no one steps updif/expertExtensive knowledge (implications, ramifications) requiredExtensive knowledge (implications, ramifications) requiredeffort/daysEstimated to take multiple days, but less than a weekEstimated to take multiple days, but less than a weektopic/gatewayIssues related to HTTP GatewayIssues related to HTTP Gateway
Description
Extracting context from internal https://github.com/orgs/ipshipyard/projects/1/views/1 to create a public log why
Content-Locationwas added in #603
Problem
/ipfs/cidcan return different bytes based onAcceptheader which caused bugs in the past (block response being returned instead of deserialized one etc)- We can't use
Vary: Acceptbecause we don't want cache key to be different for every blient/browser, we only want it to be different for block/car/ipns-record/tar/(dag-)json|cbor content types
- We can't use
Solution
- Old bifrost-infra had custom code that uses custom cache key if response is block or car
- Generic HTTP stack like LB from Cloudflare may not have that capability, and if it does, it requires custom config similar to one we did in Nginx.
- Better to solve this at gateway level, using generic HTTP, with safe defaults that "just work" with stock HTTP tools and services, without requiring additional config on each deployment
Ideas
- (A) Ensure unique URL per response type, so it does not matter if HTTP middleware is not aware of our content-types
- Return HTTP 302 to
?format=car|raw|foowithCache-Control: no-cachewhen alternative response format is requested- DOWNSIDE: bypasses http caches, hits backend every time (path needs to be resolved, blocks fetched/read)
- Return HTTP 302 to
- (B)
- Include
Content-Location: [...]?format=foowith non-default response - Implement in boxo/gateway + update gateway specs
- Include
- (C) use
Vary: Acceptand pay the penalty of more cache misses
Plan
- 2024-04-08 implement (B) for now, and test with popular LB/CDN provider like Cloudflare
- 2024-04-18 gateway: add Content-Location for non-default response formats #603 is ready
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High: Likely tackled by core team if no one steps upHigh: Likely tackled by core team if no one steps updif/expertExtensive knowledge (implications, ramifications) requiredExtensive knowledge (implications, ramifications) requiredeffort/daysEstimated to take multiple days, but less than a weekEstimated to take multiple days, but less than a weektopic/gatewayIssues related to HTTP GatewayIssues related to HTTP Gateway