Re: Push and Caching

Patrick McManus <mcmanus@ducksong.com> Fri, 22 August 2014 00:24 UTC

Return-Path: <ietf-http-wg-request@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 959121A0671 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 21 Aug 2014 17:24:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.947
X-Spam-Level:
X-Spam-Status: No, score=-6.947 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.668, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] 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 db-aRi332MMW for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 21 Aug 2014 17:24:19 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E25261A04B9 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Thu, 21 Aug 2014 17:24:18 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1XKcbY-0004Rb-El for ietf-http-wg-dist@listhub.w3.org; Fri, 22 Aug 2014 00:21:20 +0000
Resent-Date: Fri, 22 Aug 2014 00:21:20 +0000
Resent-Message-Id: <E1XKcbY-0004Rb-El@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <patrick.ducksong@gmail.com>) id 1XKcb2-0004LE-GM for ietf-http-wg@listhub.w3.org; Fri, 22 Aug 2014 00:20:48 +0000
Received: from mail-qa0-f47.google.com ([209.85.216.47]) by lisa.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <patrick.ducksong@gmail.com>) id 1XKcb0-0000Ud-0L for ietf-http-wg@w3.org; Fri, 22 Aug 2014 00:20:48 +0000
Received: by mail-qa0-f47.google.com with SMTP id i13so8837018qae.20 for <ietf-http-wg@w3.org>; Thu, 21 Aug 2014 17:20:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=qp4utgfzNinpsCaSX/VZME7w897FyxD/1Wj0Dw7eqvg=; b=uJb8d4EVtUtSVcpC5Mu5/aXokVQaNQPnJgvYs/YBnDIDQYkvsvPfj6z44rriC2Aebh j08qz7sHXTQ3Txn74LQ/U15R8V0Yn8nyr9mQHbsZBQNnrClX+94m+k1n6I0WzVjPB9sT Kme0OO/VEfH+D87YXiI111vMiNxGfteQRiogq/kko+rSXj6fIZ1lthzQw08olsuwB/No Ay1lVFuDSvzuN18Dt0ZQvYKjAQN5KB67MqCOAXD511ybRw4rSgTZdpAvuTy0bWe/0Oe6 U2vtoVWiMUdurT89U+iamLjS1ZR7XzVW8xfHW0ddObF2fgbiuLSEoWzUSgV5t11fz0Ka gcWA==
MIME-Version: 1.0
X-Received: by 10.140.22.137 with SMTP id 9mr3182213qgn.4.1408666819716; Thu, 21 Aug 2014 17:20:19 -0700 (PDT)
Sender: patrick.ducksong@gmail.com
Received: by 10.140.104.161 with HTTP; Thu, 21 Aug 2014 17:20:19 -0700 (PDT)
In-Reply-To: <d94a3acceb954583a61b0118381df417@BL2PR03MB132.namprd03.prod.outlook.com>
References: <dc3d860ecb4b4d408a5ed0519a036e61@BL2PR03MB132.namprd03.prod.outlook.com> <CABkgnnWvKgyDcm-1jEKZUA2Qza9M46X+X_QybwuqRwvSUrTjNw@mail.gmail.com> <B6B89855-237F-44DA-B29C-2A3BB5CE0EED@mnot.net> <920b92b90a3c47ef8d450c903b83af40@DM2PR05MB670.namprd05.prod.outlook.com> <d94a3acceb954583a61b0118381df417@BL2PR03MB132.namprd03.prod.outlook.com>
Date: Thu, 21 Aug 2014 20:20:19 -0400
X-Google-Sender-Auth: z2zJycE2CLQ1vP7vBTekXJNUe6I
Message-ID: <CAOdDvNpa5WR4LJbsgQaBE3bTSAc+gXfYqCmV+zmUzE5b7+1a9A@mail.gmail.com>
From: Patrick McManus <mcmanus@ducksong.com>
To: Mike Bishop <Michael.Bishop@microsoft.com>
Cc: William Chow <wchow@mobolize.com>, Mark Nottingham <mnot@mnot.net>, Martin Thomson <martin.thomson@gmail.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="001a11c14b046572dd05012ccd1c"
Received-SPF: pass client-ip=209.85.216.47; envelope-from=patrick.ducksong@gmail.com; helo=mail-qa0-f47.google.com
X-W3C-Hub-Spam-Status: No, score=-3.4
X-W3C-Hub-Spam-Report: AWL=-2.748, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1XKcb0-0000Ud-0L a893f41bf20c8780a10f2178b5f8f729
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Push and Caching
Archived-At: <http://www.w3.org/mid/CAOdDvNpa5WR4LJbsgQaBE3bTSAc+gXfYqCmV+zmUzE5b7+1a9A@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/26699
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>

another +1.. we definitely want to be able to use a non-cacheable push
response one time if it isn't going into a general cache layer.


On Thu, Aug 21, 2014 at 5:47 PM, Mike Bishop <Michael.Bishop@microsoft.com>
wrote:

> On our client side, we do have the (optional) concept of a navigation as a
> group of requests from the client, if the caller chooses to inform us of
> that grouping.  Internally, we treat push as a pre-response, not a cache
> insertion -- if the client never actually makes the corresponding request
> during the navigation, we won't cache it even if it's cacheable; if the
> response isn't cacheable, we'll still deliver it to the client if it's
> requested as part of the same navigation.  Any pushed content that's
> unretrieved when the navigation concludes gets discarded.
>
> Mark's change makes part of that behavior invalid, and we need to nail
> down what the spec-compliant behavior is.
>
> You're right that a proxy probably isn't going to have that information,
> just as we don't from all callers.  It could possibly scope that to
> requests from the same client in a certain period of time, use the Referrer
> header, or other heuristics to know when a request is "related" to the one
> that the push happened on.
>
> -----Original Message-----
> From: William Chow [mailto:wchow@mobolize.com]
> Sent: Thursday, August 21, 2014 2:27 PM
> To: Mark Nottingham; Martin Thomson
> Cc: Mike Bishop; HTTP Working Group
> Subject: RE: Push and Caching
>
> The discussion on "matching hint responses to requests" imply that
> pushed/prefetched responses need "navigation context" or a "document wide
> cache" to avoid having an HTTP2 layer unnecessarily revalidate just-pushed
> responses. While this might be possible for a browser/UA (although it
> implies coordination b/t the HTML and HTTP layers in that UA), this seems
> impractical for a proxy.  IOW, a proxy would only have limited context
> (e.g. Referer?) to avoid unnecessarily revalidating just-pushed responses.
> So, am I understanding that correctly, or have I missed something?
>
> --Will
>
> -----Original Message-----
> From: Mark Nottingham [mailto:mnot@mnot.net]
> Sent: Tuesday, August 19, 2014 7:50 PM
> To: Martin Thomson
> Cc: Mike Bishop; HTTP Working Group
> Subject: Re: Push and Caching
>
> So, in that change I was just trying to be clear about what "cacheable"
> meant; note that in the original text, it linked to *response* cacheability
> in RFC7234, not request.
>
> Mike, for your use case, CC: no-cache *is* cacheable; it just needs to be
> revalidated before reuse. See <
> http://httpwg.github.io/specs/rfc7234.html#response.cacheability> and <
> http://httpwg.github.io/specs/rfc7234.html#cache-response-directive>
>
> Things get a bit nasty here because we don't define the scope of validity
> for a newly-pushed response, but we could nail that down with a bit of
> work, I think.
>
> If we want to be able to push *truly* uncacheable responses (e.g., CC:
> no-store), we could say that a) cacheable pushed responses SHOULD be stored
> by caches, whereas uncacheable pushed responses MAY be consumed by the
> receiving application or discarded. This makes me a bit nervous, as HTTP/2
> isn't chartered to create new HTTP semantics, and that's sailing awfully
> close to the wind...
>
> Regardless, we need to be a bit more careful with words there, since
> response cacheability is partially determined by whether the cache is
> shared, and the server generating the response can't know the nature of
> downstream caches.
>
> I'll try to come up with an improvement in a pull request.
>
> BTW, this all ties up really closely with what the application does
> *after* the HTTP cache in browsers; this is all only roughly specified at
> the moment, see:
>   https://github.com/igrigorik/resource-hints/issues/5
>   https://www.w3.org/Bugs/Public/show_bug.cgi?id=26350
>
> Cheers,
>
>
>
> On 20 Aug 2014, at 3:25 am, Martin Thomson <martin.thomson@gmail.com>
> wrote:
>
> > On 19 August 2014 08:21, Mike Bishop <Michael.Bishop@microsoft.com>
> wrote:
> >> I missed when that change happened.  Can someone with better git-fu
> >> remind me?  Was there list discussion?
> >
> > https://github.com/http2/http2-spec/commit/3cec55e8
> >
> > The change title: untangle relationship between pushing, promising,
> > and caching
> >
> > -          A server can only push responses that are cacheable (see
> > <xref target="HTTP-p6" x:fmt=","
> > -          x:rel="#response.cacheability"/>); promised requests MUST
> > be safe (see <xref
> > -          target="HTTP-p2" x:fmt="," x:rel="#safe.methods"/>) and
> > MUST NOT include a request body.
> > +          A server can only push requests that are safe (see <xref
> > target="HTTP-p2" x:fmt=","^M
> > +          x:rel="#safe.methods"/>), cacheable (see <xref
> > target="HTTP-p6" x:fmt=","^M
> > +          x:rel="#response.cacheability"/>) and do not include a
> > request body.^M
> >
> > This was part of what was intended to be an editorial fix, along with
> > a large bunch of other edits
> > (https://github.com/http2/http2-spec/commits/master?page=18) and I
> > missed the subtle, but substantive change in the midst of the rest.
> >
> > I think that the `Cache-Control: nocache` response is a useful
> > feature.  I do remember being careful to permit uncacheable responses,
> > knowing that this would be an important use case.  I want to be able
> > to use push to trivially replace long-polling and this would help with
> > that.
> >
> > Maybe Mark can defend his change.
>
> --
> Mark Nottingham   https://www.mnot.net/
>
>
>
>