Re: Prefer-Push, a HTTP extension.

Evert Pot <me@evertpot.com> Fri, 23 November 2018 22:14 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 (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A522A129A87 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 23 Nov 2018 14:14:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3
X-Spam-Level:
X-Spam-Status: No, score=-3 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=evertpot.com header.b=leX1+Rqu; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=MA63g6co
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 1ZkjOwuXN-WN for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 23 Nov 2018 14:14:09 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [IPv6:2603:400a:ffff:804:801e:34:0:38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 63B61128AFB for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 23 Nov 2018 14:14:09 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1gQJg1-0005tz-Tn for ietf-http-wg-dist@listhub.w3.org; Fri, 23 Nov 2018 22:11:53 +0000
Resent-Date: Fri, 23 Nov 2018 22:11:53 +0000
Resent-Message-Id: <E1gQJg1-0005tz-Tn@frink.w3.org>
Received: from titan.w3.org ([2603:400a:ffff:804:801e:34:0:4c]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <me@evertpot.com>) id 1gQJfy-0005tM-EG for ietf-http-wg@listhub.w3.org; Fri, 23 Nov 2018 22:11:50 +0000
Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <me@evertpot.com>) id 1gQJfx-0001rf-3g for ietf-http-wg@w3.org; Fri, 23 Nov 2018 22:11:50 +0000
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 81A19221F5 for <ietf-http-wg@w3.org>; Fri, 23 Nov 2018 17:11:28 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 23 Nov 2018 17:11:28 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=evertpot.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=b4ts1UdO+WsaDfvKSyUT38V+hwyTNip8Z1wBuJCDxVg=; b=leX1+RquwM3g yRMsUSB4hOIhjwzAiwhS4h4Lh1Ji7aFoPakn7PMox4r4bNGrXG3WdKWY+piMAV9j sfylo2UlimMTLUyOX98o0oyDIQQJpCUV2i+XnhQgsU5xoJlz0EUjlLhxXkVvTUsB dPAzF3YX4CI/hm3OMyC3jYgcnnAGnDE=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=b4ts1UdO+WsaDfvKSyUT38V+hwyTNip8Z1wBuJCDx Vg=; b=MA63g6coFD+SM4uANggMOgE04bVsG89TfBem1EF31mcfkZrutocqheQDu L4KF/RqpZ7cNMUWUIKiYAUNBxNNx5v9nVZ4IC8j0wG9bbCH9+Gds0fP1H+X5aZxm k2TdauTUDEaWFkmoTKjKb89CtBz8jAwdlFQo4EnMLjT5kKsA+zG9FeXbj+/bcXIK s1iVDNsD3UJAH3miGa3Y17BUOSy2CDJho+B6HcTNDShXdizz0oAVLKP0fNwzL2Zz z3HpmOpGclhc4BUvNzqfjgA3CZyzLOPaD1Y7uvaSmMha+QGre0YOAXeorxgVxxf0 6cXaMk+pfVkEIlViTD7JlJr8dU4ug==
X-ME-Sender: <xms:D3v4W_Gah1Wsox1NyN2Xc1PkFZpqaPpB_kmXrmXLGdMEhK4Nzkp2ag>
X-ME-Proxy: <xmx:EHv4W6qtr0Q4hilFRmxJKZ6rlgqsB15BKgHkrHNeYLN88MMyUrldLQ> <xmx:EHv4W7AZG6NSiXzhAMBNcE7guSbVtfoLXhRWKkJrYwhv8HsOOr4qkQ> <xmx:EHv4WwpLaeLYzlS2ygTKKMWnIrRAYkHBHQ8LS2M4j9JYrMSLyLdUUA> <xmx:EHv4W7kB9tMxAlwCY_uBpXnxD4DRY2L-WpLzojtInMxvbqJo9tV9gg> <xmx:EHv4W9UE2-MKgt7ZeUlHiKzz_opEa-dOfc1HISQywIklXX1npbx2jQ> <xmx:EHv4W1KCNNA9wO-BqIapzge1UQzlGewBDvxIEZlkCNqU0FFDq4erUw>
Received: from [10.1.1.160] (cpe906cacd530a0-cmf81d0fae9e00.cpe.net.cable.rogers.com [99.229.198.42]) by mail.messagingengine.com (Postfix) with ESMTPA id A2795102F1 for <ietf-http-wg@w3.org>; Fri, 23 Nov 2018 17:11:27 -0500 (EST)
To: ietf-http-wg@w3.org
References: <18d0e93b-67e1-cfed-5418-fd50594fc5f9@evertpot.com> <A1C8E610-7ECF-43A9-8159-72D1E03E6311@mnot.net>
From: Evert Pot <me@evertpot.com>
Openpgp: preference=signencrypt
Autocrypt: addr=me@evertpot.com; keydata= xsFNBFtJFSYBEADPmEBaJC5Ey79441MLntdIDOecV/Jvro+k0nPT4pnlxyJX5nDDN7NP2FcW Z+QyQJ5Ib1K2OP317EE1RZ0yQVXdlBcG4Hn5ggUJ21cq3HAvOAs3CNuJtTtTcQWa+mMxcie1 27qcsvu4HZOoaEWnZl7nkhXcyj6VoBCrjCpnHr8bMDdcvj2tf6gLhqL+P0WflVd/5i8Y/3t3 nyiU7kTt49+h5P2h40oLc8IyO1LMHYf8937k//zImnBxOW/0h0uWAXawv0FJAKV6BcKu+3z7 woO7niTmlOmwHz1bF9BywDZmWsPZU8Etmthej3SH01LB96hEexjygOjVVcEbZEPnQxoyg1PR 4FgkYj/JFp80I4bOI49ZrUcjdxzjRS6yIvr2WTdqpEHbRayiuAWxA8OIt2aFjb9rPahZTyUt bn9g8mWCkKUqoKMbMiEQvpB2pNsDF5A25Z62FkSwk96a0I2NXEF47Xf3wpvtrBDm5WuuADfX OfAGsFdTU0X52uRlbfOnO+yDGmJnReWqewf95I7ikygbegNIQh8P7NSKK5mdCE8o7DiUb3iD rriBrp6qQmzvF1TezLjoI8MWDfAYWrRsxA4mwAKHIZ0HGLUZTA3bw9+07FRpL4oOdJUMc9J6 m8mP+HWE+gQpS7cinv9HC0FUp0Dhp/0BZkwvsslQQ9FdQCsMiwARAQABzRtFdmVydCBQb3Qg PG1lQGV2ZXJ0cG90LmNvbT7CwZQEEwEIAD4WIQSkMuXfRzs70V6UIiq3UVOR0jM1HQUCW0kV JgIbIwUJCWYBgAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC3UVOR0jM1HdAgEACmQtD4 GCyhdJ7EZd0PHlkHrjaCDnE7YRIZDT8977GxBxyQYeCdh7QoMhpW/fyFxBmL8AAlv9VgB/Jq 9Mb5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Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <A1C8E610-7ECF-43A9-8159-72D1E03E6311@mnot.net>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-W3C-Hub-Spam-Status: No, score=-4.8
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1gQJfx-0001rf-3g 58b6a3c00782294af27ebe03bd58e82a
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Prefer-Push, a HTTP extension.
Archived-At: <https://www.w3.org/mid/9f39ff3d-fe37-14fb-5fb0-e03413d0316e@evertpot.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/36093
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: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>


On 11/23/18 1:12 AM, Mark Nottingham wrote:
> Hi Evert,
> 
> Just some personal thoughts. 
> 
> Although folks are generally not as optimistic about Push as they used to be, I think there's still some appetite for considering it for non-browsing use cases; as such, this is potentially interesting.
> 
> However, it's not clear at all how it'd work to me. Push is effectively hop-by-hop; intermediaries need to make a decision to send it, and that decision needs to be informed. How will a generic intermediary (like a CDN) know what link relations like "item" and "author" are, and how to apply them to a particular connection? 
> 
> It's likely that a server (whether an intermediary or an origin) is going to have many, many potential representations of these types to send, so it'll need to have knowledge of the format to be able to get those links out and push the appropriate responses. That doesn't seem generic -- unless you require all of the potentially pushable links to appear in Link headers (which doesn't seem like it would scale very well).

I potentially see this used in 2 ways:

* Through link headers
* By sending links in response bodies, such as HTML, HAL and ATOM.

The draft, as it's written it is agnostic about where the links appear.

The origin server will generally know which resources to send based on
these links, and link-relationships appearing in Prefer-Push would only
apply to links for which the context uri is the request uri.

In the case of Link headers, intermediaries could cache which links were
available and push optimistically. I agree though if links are in the
body, it's unlikely proxies will parse and push those. I think that's OK.

I'm not entirely sure about the potential scale concern. Is the concern
mainly about the appearance of many Link headers? Intuitively this makes
sense to me. However, for links appearing in response bodies; usually
they are already exist there so we're not really sending any additional
bytes.

> 
> Pushing *all* of the resources -- or even a significant subset -- is likely to cause performance problems of its own, as there will be contention with any other requests made for bandwidth. This is one of the big things we've learned about push in the browsing use case, and I suspect it applies here as well.

I think one of the use-cases we need to test is for example, a JSON
collection that contains "n" items. Each is represented as a resource,
and linked to the collection with an "item" link relationship.

In the past each resource may have been 'embedded' in the response body
of the collection resource, but now we're pushing them. We'll need to
benchmark to find out for what value of "n" this starts breaking.

Frankly, I have no idea even what order of magnitude "n" is in. My hope
is that once we know, we can determine a few best practices for this
feature. It's still possible that we'll find that it's just not possible
to get reasonable performance out of this, but we intend to find out.

Anyway, I'm still curious to learn a bit more about the performance
problems about doing many pushes. Is there mainly an issue with having
too many parallel H2 streams? Could it be solved by limiting the number
of parallel pushes?

If this has to do with the number of streams, I image the issue also
exist with having an similar number of parallel GET requests. But maybe
there's something specific to Push.

Evert

> 
> Cheers,
> 
> 
>> On 19 Nov 2018, at 3:27 pm, Evert Pot <me@evertpot.com> wrote:
>>
>> Hi everyone,
>>
>> We're a group of people collaborating on a HTTP extension. We would like
>> to introduce a new header that a HTTP client can use to indicate what
>> resources they would like to have pushed, based on a link relationship.
>>
>> This might look something like the following request header:
>>
>> GET /articles
>> Prefer-Push: item, author
>>
>> or
>>
>> GET /articles
>> Prefer: push="item, author"
>>
>> We see this feature being especially useful for hypermedia-style APIs.
>> Many of these types of APIs have some feature to embed resources in
>> other resources in a way that is ignored by HTTP caches.
>>
>> The work-in-progress draft can be read here:
>>
>> <https://github.com/evert/push-please/>
>>
>> My questions:
>>
>> 1. Would this group be interested in adopting this draft and bringing
>>   through the standards process?
>> 2. We're having some discussions around which HTTP Header is more
>>   appropriate. I'm curious if anyone here has any thoughts on that. The
>>   main drawback is using "Prefer" is that it requires parsing a nested
>>   format, but it might be more semantically appropriate for HTTP.
>> 3. Our group is mostly divided on one issue: whether this header should
>>   allow a client to request pushes of arbitrary depth. The cost would
>>   be increased complexity (thus a higher barrier to entry). I'm curious
>>   if anyone here has any insights that would help us make this
>>   decision.
>>
>> Arbitrary-depth example with a custom format:
>>
>>  Prefer-Push: item(author, "https://example.org/custom-rel"), icon
>>
>> Example with S-expression syntax:
>>
>>  Prefer: push="(item(author \"https://example.org/custom-rel\") icon)"
>>
>> In each of the above cases the client request the server push:
>>
>> 1. The resource(s) behind the item link-relationship
>>   a. The resources(s) behind the author relationship (via the "item"
>>      link-relationship).
>>   b. The resource(s) behind the "https://example.org/custom-rel" (via
>>      the "item" link)
>> 2. The resource(s) behind the icon relationship
>>
>> Unfortunately structured-headers doesn't support data-structures of
>> arbitrary depth, so if we want arbitrary-depth pushes, we would need to
>> pick a different format. Very open to suggestions here too.
>>
>> We intend to have several working implementations of this. For those
>> interested in discussing, most of our discussion  is happening on a
>> slack instance (http://slack.httpapis.com channel: #push-please).
>>
>> Evert et al.
>>
> 
> --
> Mark Nottingham   https://www.mnot.net/
> 
>