Re: "Timeout" request header to tell server to wait for resource to become available

Mark Nottingham <mnot@mnot.net> Wed, 01 April 2015 01:07 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D3A3F1B29FB for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 31 Mar 2015 18:07:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.912
X-Spam-Level:
X-Spam-Status: No, score=-6.912 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jlNvB20X9y-q for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 31 Mar 2015 18:07:05 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D3CE61A1AA9 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 31 Mar 2015 18:07:05 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Yd73Y-0000qj-Nq for ietf-http-wg-dist@listhub.w3.org; Wed, 01 Apr 2015 01:02:56 +0000
Resent-Date: Wed, 01 Apr 2015 01:02:56 +0000
Resent-Message-Id: <E1Yd73Y-0000qj-Nq@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.80) (envelope-from <mnot@mnot.net>) id 1Yd73V-0000pp-OQ for ietf-http-wg@listhub.w3.org; Wed, 01 Apr 2015 01:02:53 +0000
Received: from mxout-07.mxes.net ([216.86.168.182]) by lisa.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <mnot@mnot.net>) id 1Yd73U-0003aE-Nm for ietf-http-wg@w3.org; Wed, 01 Apr 2015 01:02:53 +0000
Received: from [192.168.0.16] (unknown [120.149.147.132]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 79B7422E264; Tue, 31 Mar 2015 21:02:28 -0400 (EDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <5515F653.6080506@brendanlong.com>
Date: Wed, 01 Apr 2015 12:02:25 +1100
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <200FC758-90CD-4F7B-88C4-DEAC3B7B5BB7@mnot.net>
References: <5515F653.6080506@brendanlong.com>
To: Brendan Long <self@brendanlong.com>
X-Mailer: Apple Mail (2.2070.6)
Received-SPF: pass client-ip=216.86.168.182; envelope-from=mnot@mnot.net; helo=mxout-07.mxes.net
X-W3C-Hub-Spam-Status: No, score=-8.2
X-W3C-Hub-Spam-Report: AWL=1.385, BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1Yd73U-0003aE-Nm c4e5b66f8110897716f6da23f7af6b8f
X-Original-To: ietf-http-wg@w3.org
Subject: Re: "Timeout" request header to tell server to wait for resource to become available
Archived-At: <http://www.w3.org/mid/200FC758-90CD-4F7B-88C4-DEAC3B7B5BB7@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/29154
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi Brendan,

I guess I’m wondering why this needs to be coordinated between the client and server; couldn’t the DASH server just pause before determining that it really is a 404?

I.e., are there other clients that need to know it’s a 404 right away?

Cheers,



> On 28 Mar 2015, at 11:31 am, Brendan Long <self@brendanlong.com> wrote:
> 
> Resending this as an unsigned email since someone had trouble reading it.
> 
> ---
> 
> I'm hoping this is the right group to address this to. Please let me know if I should take it somewhere else, or if I should do an independent submission instead. The use-cases I have in mind are MPEG-DASH and HLS, but I feel like this header isn't really specific to either of them, so an RFC would be a good place to define it.
> 
> Use Case: MPEG-DASH
> 
> When live streaming using MPEG-DASH, clients need to poll the server for manifest changes and new media segments. Due to fluctuations in encoding time and network latency, the client can't know exactly when a segment will be available, so it tries to request the new resource a short time after should become available (added latency). If the client requests the new resource too soon, it will get a 404 response and need to retry (introducing an RTT of latency).
> 
> It would be nice if we could just request a new media segment or updated MPD and have the server send it when it's ready.
> 
> Solution
> 
> Add a header telling the server to wait for a resource to become available before giving up. I chose to name this header "Timeout" with a value as a timeout in milliseconds. The actual timeout would be the value of the smaller of the value of the timeout header or the server's own configured timeout. If the client also sends an "If-None-Match" header, the server should also calculate etags (however it chooses to do so) and wait to send to a 200 or 304 response until the etag of the resource changes.
> 
> Header Examples
> 
> Basic:
> GET /rep1/segment-1.mp4 HTTP/1.0
> Timeout: 5000
> Meaning: Give me /rep1/segment-1.mp4 as soon as you see it, but you can give up after 5000 ms.
> 
> With ETag:
> 
> GET /manifest.mpd HTTP/1.0
> Timeout: 5000
> If-None-Match: W/"5f0-1193253510" 
> 
> Meaning: Give me /manifest.mpd as soon as you see it and the etag doesn't match W/"5f0-1193253510", but you can give up after 5000 ms.
> 
> Software Examples
> 
> I wrote some Express middleware to implement this behavior here:
> 
> https://github.com/brendanlong/express-timeout-header
> 
> And an example demonstrating the usage with media segments MPEG-DASH in Google Chrome:
> 
> https://github.com/brendanlong/dash-http-timeout
> https://www.youtube.com/watch?v=YUcfNzPaqf0
> 
> Conclusion
> 
> Does this seem like a good idea? Are there other use-cases? Should I write some sort of RFC?
> 
> 
> PS -
> 
> As I write this, I'm starting to wonder if we just need headers like "Wait-Until: available" or "Wait-Until: etag-changes", since you can always close the HTTP connection, but the timeout could be useful for HTTP/1.1 pipelining. Either way works for me though.
> 
> See here if that's your preference:
> 
> https://github.com/brendanlong/express-timeout-header/tree/wait-until

--
Mark Nottingham   https://www.mnot.net/