Hi all, We've been working on a new feature for Traffic Router that will add support for providing multiple locations in the response to a client for HTTP delivery services. Phil has proposed a spec for the response format, which is roughly comprised of the following:
1) 302 redirect 2) Location header with the preferred endpoint URL 3) JSON response body containing multiple URLs, the first URL is the same as the Location header We've built this feature on top of the steering delivery feature, but extended it to allow us to return a list of URLs based on the subordinate delivery services instead of a single endpoint based on one of the subordinate delivery services. We use the same code and consistent hashing, but we now include, in order, the "best" endpoint across all subordinate delivery services. The following is an example request if we have a multi-location steering delivery service, foo, and two subordinates: foo-a, foo-b, noting the two different delivery services in the JSON body: > GET /a HTTP/1.1 > Host: tr.foo.cdn.example.com > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 302 Moved Temporarily < Server: Apache-Coyote/1.1 < Location: http://cache-01.foo-a.cdn.example.com/a < Content-Type: application/json < Content-Length: 149 < Date: Wed, 01 Mar 2017 18:00:11 GMT < { [149 bytes data] * Connection #0 to host localhost left intact { "locations" : [ "http://cache-01.foo-a.cdn.example.com/a", "http://cache-01.foo-b.cdn.example.com/a" ] } Another important implementation detail is that not all HTTP client libraries are able to parse a JSON body when a 302 response and Location header are present. Because of this, we are also allowing a query parameter, currently "redirect=false", which will cause a 200 response with no Location header. This is similar to the "format=json" query parameter precedent that we currently allow for non-multi-location responses. In Traffic Ops, we will introduce a new type called "CLIENT_STEERING" and an additional boolean value in the steering.json API endpoint called clientSteering. Traffic Router will consume this, see the value and serve a multi-location response if set to true. Phil's draft can be found here: https://github.com/PSUdaemon/multi-location Questions/comments welcome. -- Thanks, Jeff