You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Orion currently returns sorted asset URLs whenever user requests data object info. That sorting is done based on geographical distance between the user and the target distribution node. This is done to ensure that the closest node is used and the user gets the best performing node for them possible.
However, this currently requires the user to explicitly provide their coordinates via x-client-loc header:
locationLogger.debug(`Client location resolved: ${JSON.stringify({ lat, lon })}`)
return{ lat, lon }
}
That in turn requires Atlas to fetch that location from a service and forward it to Orion. I don't think that makes much sense. Instead, Orion could just use user's IP that it knows anyway from their request and extract location from that. There are few ways that can be done, either using local DB or an external service (for example the same Cloudflare Worker that Atlas currently uses).
The upside is that Orion will always have location data, even if user didn't provide it. With the current approach I guess it may be possible that some initial requests to Orion from Atlas will not include location data because it was not fetched yet. This is important for people being sent a link to a specific video for example.
One downside that I guess comes from that is that the user doesn't have an option to override that location, but I'm almost 100% sure that nobody used that feature in Atlas anyway so I don't think it hurts to lost that option.
One potential complication: if the location comes from the user, it's resolved only once and then kept cached in their local storage so it's not needed to resolve it every time users requests an asset. If we move that to Orion, we should most likely introduce some cache based on IP or user session
The text was updated successfully, but these errors were encountered:
Orion currently returns sorted asset URLs whenever user requests data object info. That sorting is done based on geographical distance between the user and the target distribution node. This is done to ensure that the closest node is used and the user gets the best performing node for them possible.
However, this currently requires the user to explicitly provide their coordinates via
x-client-loc
header:orion/src/server-extension/resolvers/AssetsResolver/index.ts
Lines 178 to 191 in 05fb302
That in turn requires Atlas to fetch that location from a service and forward it to Orion. I don't think that makes much sense. Instead, Orion could just use user's IP that it knows anyway from their request and extract location from that. There are few ways that can be done, either using local DB or an external service (for example the same Cloudflare Worker that Atlas currently uses).
The upside is that Orion will always have location data, even if user didn't provide it. With the current approach I guess it may be possible that some initial requests to Orion from Atlas will not include location data because it was not fetched yet. This is important for people being sent a link to a specific video for example.
One downside that I guess comes from that is that the user doesn't have an option to override that location, but I'm almost 100% sure that nobody used that feature in Atlas anyway so I don't think it hurts to lost that option.
One potential complication: if the location comes from the user, it's resolved only once and then kept cached in their local storage so it's not needed to resolve it every time users requests an asset. If we move that to Orion, we should most likely introduce some cache based on IP or user session
The text was updated successfully, but these errors were encountered: