Re: Server Push and Caching

David Witherspoon <dwitherspoon2011@gmail.com> Fri, 26 May 2017 21:54 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 240761204DA for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 26 May 2017 14:54:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.5
X-Spam-Level:
X-Spam-Status: No, score=-6.5 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 kySRkWXL0fuv for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 26 May 2017 14:54:52 -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 8F4E01243F6 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 26 May 2017 14:54:52 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1dEN8y-0007h0-SM for ietf-http-wg-dist@listhub.w3.org; Fri, 26 May 2017 21:51:36 +0000
Resent-Date: Fri, 26 May 2017 21:51:36 +0000
Resent-Message-Id: <E1dEN8y-0007h0-SM@frink.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <dwitherspoon2011@gmail.com>) id 1dEN8t-0007fl-VC for ietf-http-wg@listhub.w3.org; Fri, 26 May 2017 21:51:31 +0000
Received: from mail-vk0-f43.google.com ([209.85.213.43]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <dwitherspoon2011@gmail.com>) id 1dEN8m-0001Bt-8Z for ietf-http-wg@w3.org; Fri, 26 May 2017 21:51:26 +0000
Received: by mail-vk0-f43.google.com with SMTP id p85so11044623vkd.3 for <ietf-http-wg@w3.org>; Fri, 26 May 2017 14:51:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kP4C0C0S2xoZ7B7sSBsnKATs/+pscxu4sz5pKhZ/Wvk=; b=RKKL+i1X0QYgs0Jzxw2bOWjFiVGK0ZFBz76uiq34qgaNaJs2D9cM1khfVwCbwEfZFT 0/iRQtZZfaoJSvFvm+gKBX/mgZaqMzTJVniZKH1m70kQI5TP86sbvfGD2JqfZupE+htk ZUQtQnbpp/9kzrGE6eO5YDVs3y5q8tft5opBl5x1HXWeLgoTsbEZbXpDJwAiiMF7Inoy ejQPMRkQ33F7VbMlUlMvF901Cj6HEPYsy+iQwoHVLGbduTOCHetP+hXYrhH3Idpvkpl1 tqytVGoHp4zH3WFeeV4gFYydCp6TrLP7fOxUOC+99wPWURTv0sz2YrIZ3BXC9B6A6fu0 gMXQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kP4C0C0S2xoZ7B7sSBsnKATs/+pscxu4sz5pKhZ/Wvk=; b=cj2uGNQk8zRGA0tP781TbDXQfGq5WfeTamxsKeCh8tWtqv28JZZ+fgNr5dhPmVFVtW Vedj5Pxhn0bxxHXw3gOMA/dCXFfXCaN9s2xS1JI0Lu4IJLxkFKJnmhHRX9+7JYtEy+V2 yhke4ZYBXcVdDGCHRe+V+jTgN27QHh7guPUpZ8w1PunkDblBE5imvlZbA0OQ+xzst2ao 1uwRUTceZPnOzMImPnJ8cQ1zDZzVqyP9p60jrMGji4MZ5Wo4Vl+oVEWAbLW4ZpfUWWLQ OyK0o7rSfqmzmJwm+uo+Kf+8GIINiaI4nVPF+SQnzb4dr3uAGcMCbUBHTE1hrrrt4kne Z1+A==
X-Gm-Message-State: AODbwcDqvLWIyvm7JLXgdsEQPhxiKvVbdAJv6prr6QFjZF5b3pSLQguH drg2h+0xi4pgULvEdIWvosE9BDhflSSG8Zk=
X-Received: by 10.31.7.202 with SMTP id 193mr1334597vkh.132.1495835457507; Fri, 26 May 2017 14:50:57 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.176.3.133 with HTTP; Fri, 26 May 2017 14:50:57 -0700 (PDT)
In-Reply-To: <CAOdDvNrETmv7BfOg9r8e5U9_oDWtaovvE+cv1MFXXD0hK5yVHQ@mail.gmail.com>
References: <CAGnbNm78FYtC_CU2V+CbBTvP6qPzVgGNXyowoFRK1fw7T=_dDQ@mail.gmail.com> <CAOdDvNrETmv7BfOg9r8e5U9_oDWtaovvE+cv1MFXXD0hK5yVHQ@mail.gmail.com>
From: David Witherspoon <dwitherspoon2011@gmail.com>
Date: Fri, 26 May 2017 14:50:57 -0700
Message-ID: <CAGnbNm7m7QEkCTFwuhVJw-6_cozHOjWOcjcivNa+Pq5i5VBs3w@mail.gmail.com>
To: Patrick McManus <mcmanus@ducksong.com>
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="001a1143d320165735055074554e"
Received-SPF: pass client-ip=209.85.213.43; envelope-from=dwitherspoon2011@gmail.com; helo=mail-vk0-f43.google.com
X-W3C-Hub-Spam-Status: No, score=-6.0
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1dEN8m-0001Bt-8Z 5045131ac30fe39426f5c7bcef9918cf
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Server Push and Caching
Archived-At: <http://www.w3.org/mid/CAGnbNm7m7QEkCTFwuhVJw-6_cozHOjWOcjcivNa+Pq5i5VBs3w@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33957
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>

Yes, thanks for the clarification.  I agree invalidation is too strong of
wording.  Rather a request with cache-control: no-cache directive allows
for updating or adding entries to the cache.

> it certainly doesn't MUST or even SHOULD it.

I believe I might still disagree but let me clarify the scenario:

1. client issues request 1, and gets a cache-able response 1.
2. The client then issues the same request (request 2) but with the
no-cache cache request directive and gets a cache-able response 2 from the
origin server.
3.  The client issues request 3 that matches both previous requests and
assume both responses are valid.  rfc7234#section-4.4 states that "When
more than one suitable response is stored, a cache MUST use the most recent
response".  So response 2 would presumably be served from cache to answer
request 3  (OR It can also forward the request with "Cache-Control:
max-age=0" or "Cache-Control: no-cache" to disambiguate which response to
use.)

If we now assume that request 2 is server-initiated via a push promise, and
that the push promise is not cancelled, and the client "is just replaying"
it onto the cache then I would assume Step 3 MUST operate in the same way.

> I do agree that a cached-response that you wouldn't use to satisfy the
pushed request is not a good rationale for canceling the pushed stream

Agreed, this arose because Chrome has a PR that implements an optimization
on their implementation of just replaying it onto the cache.  That
optimization "Cancel[s] unnecessary push streams when it's discovered
they're in cache".  I believe the semantics of a no-cache request header is
well defined such that it can't already be discovered in cache.  Sure it
can cancel the Push Promise for any reason, but in this case, it is
ignoring the semantics that the no-cache request directive syntax defines.

Note, if response 2 has a longer validation lifetime then response 1, then
I believe it is behaviorally equivalent to invalidating response 1.

On Fri, May 26, 2017 at 1:16 PM, Patrick McManus <mcmanus@ducksong.com>
wrote:

>
>
> On Wed, May 24, 2017 at 1:27 PM, David Witherspoon <
> dwitherspoon2011@gmail.com> wrote:
>
>> > The only native HTTP mechanism for cache invalidation is described in
>> RFC7234, Section 4.4:
>>
>> [
>
>> RFC7234 Section 5.2.1.4 defines one, (request cache-directive, no-cache):
>>
>> The “no-cache” request directive indicates that a cache MUST NOT use
>> a stored response to satisfy the request without successful
>> validation on the origin server.
>>
>
> istm that you are confusing invalidation with use. 5.2.1.4 doesn't say
> anything about invalidating the cache - bypassing when satisfying that
> request is fine and even sensible if you expect multiple variants. Sec 4.4.
> does talk about invalidation in the face of responses to unsafe methods but
> a] 7540 does not allow pushing unsafe methods, and b] 4.4. is clear that
> this only applies to caches that it "travels through" and its not clear
> that 7540 push operates directly on a cache even though it has cache
> semantics.
>
> its not clear exactly how pushes should be applied by clients.. they are
> making small movements towards "just replaying them" onto the cache
> directly, but its obvious that can't be the whole story.. e.g. a response
> containing cache-control: no-store is explicitly allowed for use by 8.2 and
> that wouldn't work if promised streams were just directly use to populate a
> cache.
>
>
>> It would be semantically incorrect to cancel a server-initiated request
>> with a no-cache request directive for the sole reason that it is already
>> has a cached response.
>>
>
> I don't know that I would go as far as "semantically incorrect" because I
> don't think you have the semantics you're looking for :).. but I do agree
> that a cached-response that you wouldn't use to satisfy the pushed request
> is not a good rationale for canceling the pushed stream. But as far as
> correctness goes, you don't need a good reason to correctly cancel any push.
>
>
>> In fact, the premise that a server-initiated request with a no-cache
>> request directive can already have a cached response violates semantic
>> equivalency. Any request, client or server initiated, with a no-cache
>> request directive can not by RFC have a validated response in the cache.
>>
>>
> I would agree with that. but I think you might also be implying that the
> cache needs to invalidate any previously stored entry for the same URL..
> and I don't agree with that :) (though it could.)
>
>
>
>> Assuming the Push Promise goes through (client still may cancel the Push
>> Promise for any reason), this clearly allows for overwriting an existing
>> cached response, specifically replacing a cache entry.
>>
>
> I agree it allows that. it certainly doesn't MUST or even SHOULD it. It
> might be reasonable.
>
>
>