Re: Why should caches and intermediaries ignore If-Match?
Tom Bergan <tombergan@chromium.org> Fri, 03 March 2017 23:35 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 96F7B1293E3 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 3 Mar 2017 15:35:18 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.02
X-Spam-Level:
X-Spam-Status: No, score=-7.02 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_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 (1024-bit key) header.d=chromium.org
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 Ya_8NgIR6kd6 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 3 Mar 2017 15:35:16 -0800 (PST)
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 707F3128B38 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 3 Mar 2017 15:35:16 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cjwg3-000134-6F for ietf-http-wg-dist@listhub.w3.org; Fri, 03 Mar 2017 23:31:59 +0000
Resent-Date: Fri, 03 Mar 2017 23:31:59 +0000
Resent-Message-Id: <E1cjwg3-000134-6F@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 <tombergan@chromium.org>) id 1cjwft-00011e-KC for ietf-http-wg@listhub.w3.org; Fri, 03 Mar 2017 23:31:49 +0000
Received: from mail-wr0-f179.google.com ([209.85.128.179]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <tombergan@chromium.org>) id 1cjwfi-0001v5-5p for ietf-http-wg@w3.org; Fri, 03 Mar 2017 23:31:44 +0000
Received: by mail-wr0-f179.google.com with SMTP id g10so83096186wrg.2 for <ietf-http-wg@w3.org>; Fri, 03 Mar 2017 15:31:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=PJ0JLNqvmF4X27bNKbsP/mO3aTiOaBuefpMaYr0Djfk=; b=EbgPCIEDqNkPKvIGytfP8gnsBB+Ts9OHGESEP5Rwji2mnGF+Ve/f3bdyQ/PIO8VgH1 QuBjScPzJVBY0FMH1kPgEfLmtE8dHnsaqnI5eiYLSdGXwaNxR+KNfJw1s3LCT5zZOGsj X4ZouLsSrv1OUv1SR0bopwMYB1YiMi09lQuD0=
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=PJ0JLNqvmF4X27bNKbsP/mO3aTiOaBuefpMaYr0Djfk=; b=F3JIE4LW79E1DV9xeKGBnMTmzUewtsHviaOQmG6ztmA7UEQVs7HTvkk9EKP+sy7GVj 3qUo4XKgaPqVjpTCwORr7Bpy4vF/N5uOscU24xCJu2MZW/yTbv8/kDlX6EvOY/wvT5iA ciQrd18plTa46ktb69ikk1O56MmiKYoZmIjMctnDLEDRy93Nf43cmxN0u2yM7bdPU10e Q6XqaQPb30Az08P3LGYY08FDzOGFgFDPLG4WlLfsXIjdx4HID64ajdTKVel9s5V4/T5Y BS7Kc73Tv6TWGf+02KNCDwStX2IxTF2p+cuc54D2P0chzDJxfA1ysskQ+QKcG5MlP+Gq +6hg==
X-Gm-Message-State: AMke39lqPzS+0V0/XJpHQILiW4cEFmPRZCj6KVkNs7oH0qkQnSJiRUr2jHPDArY4vrzy+/v3
X-Received: by 10.223.175.196 with SMTP id y4mr4623249wrd.77.1488583492471; Fri, 03 Mar 2017 15:24:52 -0800 (PST)
Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com. [209.85.128.174]) by smtp.gmail.com with ESMTPSA id 10sm4753144wmi.23.2017.03.03.15.24.51 for <ietf-http-wg@w3.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2017 15:24:51 -0800 (PST)
Received: by mail-wr0-f174.google.com with SMTP id u48so83153438wrc.0 for <ietf-http-wg@w3.org>; Fri, 03 Mar 2017 15:24:51 -0800 (PST)
X-Received: by 10.223.136.182 with SMTP id f51mr4406862wrf.90.1488583491319; Fri, 03 Mar 2017 15:24:51 -0800 (PST)
MIME-Version: 1.0
Received: by 10.28.135.14 with HTTP; Fri, 3 Mar 2017 15:24:50 -0800 (PST)
In-Reply-To: <3963F360-005D-41F9-BF51-EB3EBD9C6F7F@mnot.net>
References: <CA+3+x5FgdfAQ4Nos9VTGe35RiH8Z+3zZiUGH_bKXHz+VO+UAbQ@mail.gmail.com> <aaedcb18-2a19-9b77-95d9-0559e21407c2@measurement-factory.com> <CA+3+x5E_HPycm4axSLtO0jGmjDBS3=kVfhaJzKR+7n7S_yMgkg@mail.gmail.com> <DEF639B3-6A6D-4030-93D0-B7473D2A14F6@mnot.net> <9DA41CBA-673C-416B-A9CF-AD9A108C2440@gbiv.com> <CA+3+x5HZJsJ+903UKx+2O0b2dtc7o48Ks8CGrGfs=E_dXyWx-g@mail.gmail.com> <629EE31B-7235-4EFB-9C4C-CA4010165B2F@gbiv.com> <3963F360-005D-41F9-BF51-EB3EBD9C6F7F@mnot.net>
From: Tom Bergan <tombergan@chromium.org>
Date: Fri, 03 Mar 2017 15:24:50 -0800
X-Gmail-Original-Message-ID: <CA+3+x5GdrhsaE=X2qDXOaGvrLeR45X3LU8fRO761waxsBLtB3g@mail.gmail.com>
Message-ID: <CA+3+x5GdrhsaE=X2qDXOaGvrLeR45X3LU8fRO761waxsBLtB3g@mail.gmail.com>
To: Mark Nottingham <mnot@mnot.net>
Cc: Roy Fielding <fielding@gbiv.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="001a1149222e38403d0549dbda60"
Received-SPF: pass client-ip=209.85.128.179; envelope-from=tombergan@chromium.org; helo=mail-wr0-f179.google.com
X-W3C-Hub-Spam-Status: No, score=-4.7
X-W3C-Hub-Spam-Report: AWL=-0.562, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.096, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1cjwfi-0001v5-5p 54b24096e0e1aa62fc134f8852b569e2
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Why should caches and intermediaries ignore If-Match?
Archived-At: <http://www.w3.org/mid/CA+3+x5GdrhsaE=X2qDXOaGvrLeR45X3LU8fRO761waxsBLtB3g@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33654
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>
On Fri, Mar 3, 2017 at 2:58 PM, Mark Nottingham <mnot@mnot.net> wrote: > > > On 4 Mar 2017, at 9:30 am, Roy T. Fielding <fielding@gbiv.com> wrote: > > > > On Mar 1, 2017, at 5:49 PM, Tom Bergan <tombergan@chromium.org> wrote: > >> > >> Here is the use case: > >> > >> We have a content-optimization (compression) proxy sitting between the > browser and origin server. Among other things, the proxy can compress > videos. When the browser starts playing a video, it makes an initial HTTP > request to fetch (part of) the video, then builds an in-memory > representation of the video and uses additional HTTP range requests as > needed to fetch the rest of the video. For example, range requests are used > to implement seeking. > >> > >> The challenge is that we now have multiple representations of every > video: the original representation (from the origin server) and one or more > compressed representations served by the proxy. When the browser makes an > initial request for a video, it gets one of these representations. When it > makes a subsequent range request, we want to ensure that it receives the > *same* representation that it received on the initial request. Otherwise > the browser cannot combine the second response with the first response and > video playback will fail. > >> > >> An additional challenge is that the browser and proxy both have a > cache. In theory, we control the entire connection and could add custom > code to the browser, proxy, and caches to implement any protocol that we > invent. In practice, both caches are intended to be HTTP-compliant caches > and we'd rather not add custom hacks for use cases like this if we can > avoid it. > >> > >> The browser needs to label each range request with the ETag it expects > to receive. If-Match originally seemed like the perfect solution: The > browser adds `If-Match: ETag` to every range request. If a cache has a copy > of the video with a *different* ETag, the cache forwards the request to the > next server in the chain rather than returning its cached copy (as would > happen if we used If-Range instead of If-Match). Similarly, the proxy knows > if the browser is requesting a compressed video or the original video, so > it can respond accordingly. However, as discussed previously in this > thread, If-Match doesn't work like this. > >> > >> Note that I agree it doesn't make sense for a cache to return 412 and > we don't need that behavior. The semantics I'm looking for is: "Send me > this representation if you have it, otherwise forward to the next server. A > 4xx means that this representation is not current in the origin or in any > intermediate cache or proxy." > >> > >> Hope that makes sense. > > > > You have several choices: > > > > 1) implement this using transfer encodings because they don't change > range offsets; > > presumably, these would be added/removed by the protocol handlers > before > > the caches ever see them. > > Ew. Can you expand what you mean by this? I'm not sure I followed. In case I wasn't clear, the proxy actually produces a completely different transcode of the original video, possibly in a different container format or codec. The "compressed" video is actually a completely different file than the original video; this is not just compression via Content-Encoding. > 2) use If-Range and configure your proxy to forward the request when no > match; > > yes, that's legitimate HTTP (a server is free to ignore partial > requests and a proxy > > can forward any request it likes). > > Nod. This doesn't help with the caches, which return 200 when there is no match on the If-Range etag rather than forwarding the request. If we didn't have any HTTP caches in the middle, we would have already done this :) > 3) use If-Match and deal with the extra round-trip after a 412. > > Why doesn't the logic in #2 apply here as well? Intermediary servers > aren't required to 412. > > > > I don't see any reason here to change the handling of If-Match. Partial > requests are > > why we have If-Range. > > > > ....Roy > > -- > Mark Nottingham https://www.mnot.net/ > > > > >
- Why should caches and intermediaries ignore If-Ma… Tom Bergan
- Re: Why should caches and intermediaries ignore I… Alex Rousskov
- Re: Why should caches and intermediaries ignore I… Tom Bergan
- Re: Why should caches and intermediaries ignore I… Alex Rousskov
- Re: Why should caches and intermediaries ignore I… Tom Bergan
- Re: Why should caches and intermediaries ignore I… Mark Nottingham
- Re: Why should caches and intermediaries ignore I… Roy T. Fielding
- Re: Why should caches and intermediaries ignore I… Alex Rousskov
- Re: Why should caches and intermediaries ignore I… Tom Bergan
- Re: Why should caches and intermediaries ignore I… Roy T. Fielding
- Re: Why should caches and intermediaries ignore I… Mark Nottingham
- Re: Why should caches and intermediaries ignore I… Tom Bergan
- Re: Why should caches and intermediaries ignore I… Roy T. Fielding
- Re: Why should caches and intermediaries ignore I… Tom Bergan