Re: A question about RFC7232#2.2.2

Michael Lee <michael.lee@zerustech.com> Mon, 05 December 2016 18:18 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 E7987129C22 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 5 Dec 2016 10:18:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.797
X-Spam-Level:
X-Spam-Status: No, score=-9.797 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-2.896, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=zerustech-com.20150623.gappssmtp.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 NGHf2mNc6Hfe for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 5 Dec 2016 10:18:22 -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 7249E129C46 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 5 Dec 2016 10:18:22 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cDxoL-0003nj-TT for ietf-http-wg-dist@listhub.w3.org; Mon, 05 Dec 2016 18:16:21 +0000
Resent-Date: Mon, 05 Dec 2016 18:16:21 +0000
Resent-Message-Id: <E1cDxoL-0003nj-TT@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 <michael.lee@zerustech.com>) id 1cDxoD-0003mi-KY for ietf-http-wg@listhub.w3.org; Mon, 05 Dec 2016 18:16:13 +0000
Received: from mail-pg0-f41.google.com ([74.125.83.41]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <michael.lee@zerustech.com>) id 1cDxny-0006Lf-3K for ietf-http-wg@w3.org; Mon, 05 Dec 2016 18:16:05 +0000
Received: by mail-pg0-f41.google.com with SMTP id x23so139183730pgx.1 for <ietf-http-wg@w3.org>; Mon, 05 Dec 2016 10:15:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zerustech-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=Ixl+MoW2V5ThNeydjEb7hiqjNO3uTubbaOoPPnF+SLk=; b=MOUoSP2ddlTk2MbmTQS1n6grqkyYna8MLsQDkE3aZnYilxf1NLmc/IQoSy/XQobqS6 W20MZ1rxoQR/Gy6IXGb8OTl7X3pN1qyM7VvQeklYa4erlqx//hMU8zyEpd/SVIGqlZD6 3KdBZloiHup4rFGiMsehqtLj8B1kb8JmctfrQehuzGDzIj5VXEnRBd1tRufRHha3PYR3 gNRy4DaEnfXnHxNMcNn0g00xPIN1y06D3Wb2x/53GLEw7JcoTwOvQ8+IJGaeOyJ0L7Tm nSTz6eeojrOFmHcMFskzZ+m87SOsFTZcTfWPNnEXhS37ZrPqK+jyQfbmRtzqV/Icog+q t8Dg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Ixl+MoW2V5ThNeydjEb7hiqjNO3uTubbaOoPPnF+SLk=; b=U21zptLGcW+/LsdZyXSIEtwmPVGT5i0g1NrQdekTUHV7UAX02fnHtZt/i4RISa4H/N Bis3rA+K/CdvOoGWDDFAGebSgtCkldfKXuJH10lhBch4I1Tp9VdclxpmjF/CSNLXm6ic VVQXXwvWFBf2eWOI66nE7lTAWXN/Fghy8mDkw8zKTKYeNwZWrV1m0ihOUyMAjB/bp4Oo Pa2zAx6WJCSnUBVtzKwJBgNkkf1thkQ8goPYl0dfDb31ugY23a7rzaoBWEf/4lhgQp31 41j7ukpM+6QnDipol2yjhnZMHwG+XrTximaLO+T2EoQxFb4dVQtcQLBEpBJGa1YWb7xJ xxoQ==
X-Gm-Message-State: AKaTC00E4nuIcsx/4dkU05S6Ex2wPsRRLcOsZrOSc3Hxwgytm5Psyhle7iveDzjqJdqTaw==
X-Received: by 10.84.215.142 with SMTP id l14mr125617992pli.99.1480961725728; Mon, 05 Dec 2016 10:15:25 -0800 (PST)
Received: from 10.0.1.20 (ec2-52-78-85-40.ap-northeast-2.compute.amazonaws.com. [52.78.85.40]) by smtp.gmail.com with ESMTPSA id 65sm29133162pfn.12.2016.12.05.10.15.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2016 10:15:25 -0800 (PST)
To: Benedikt Christoph Wolters <benedikt.wolters@rwth-aachen.de>, julian.reschke@gmx.de
References: <58435873.2000408@zerustech.com> <CAGZNdJV55R4OcnqfNCrX-=uok3qJw4w8pzrFbWgD1ss-KPi9Sg@mail.gmail.com>
Cc: HTTP Working Group <ietf-http-wg@w3.org>
From: Michael Lee <michael.lee@zerustech.com>
Message-ID: <5845AEBA.3080800@zerustech.com>
Date: Tue, 6 Dec 2016 02:15:22 +0800
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
MIME-Version: 1.0
In-Reply-To: <CAGZNdJV55R4OcnqfNCrX-=uok3qJw4w8pzrFbWgD1ss-KPi9Sg@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Received-SPF: none client-ip=74.125.83.41; envelope-from=michael.lee@zerustech.com; helo=mail-pg0-f41.google.com
X-W3C-Hub-Spam-Status: No, score=-6.4
X-W3C-Hub-Spam-Report: AWL=0.450, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FSL_HELO_BARE_IP_2=1.119, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, W3C_AA=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1cDxny-0006Lf-3K 28513910e642fc3747cdf527cb8fb467
X-Original-To: ietf-http-wg@w3.org
Subject: Re: A question about RFC7232#2.2.2
Archived-At: <http://www.w3.org/mid/5845AEBA.3080800@zerustech.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33115
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 Benedikt,

Thanks for your feedback.

After thinking it carefully, I think I have figured out the meaning of 
the following statement in RFC7232 section 2.2.2:

" This method relies on the fact that if two different responses were 
sent by the origin server during the same second, but both had the same 
Last-Modified time, then at least one of those responses would have a 
Date <http://httpwg.org/specs/rfc7231.html#header.date> value equal to 
its Last-Modified time. The arbitrary 60-second limit guards against the 
possibility that the Date and Last-Modified values are generated from 
different clocks or at somewhat different times during the preparation 
of the response. An implementation /MAY/ use a value larger than 60 
seconds, if it is believed that 60 seconds is too short."

The following is my explanation to the statement above:

If the client holds a response and the response’s Last-Modified time is 
not a strong validator, then it means:

1) after the client received the response,  the representation has been 
modified by the origin server again (within the same second of the 
last-modified time); and

2) it does not matter whether the 2nd modification generated a response; and

3) the events must have happened in this way: the origin server modified 
the representation for the 1st time; the origin server sent the response 
to the client; the origin server modified the representation for the 2nd 
time; otherwise

4) if the events happened like this: the origin server modified the 
representation for the 1st time; the origin server modified the 
representation for the 2nd time; the origin server sent the response to 
the client; then

5) the 1st modification was not sent to any client, therefore, it 
actually never existed and the 2nd modification became the 1st 
modification; so

6) the response must have been sent to the client within the interval 
between the 1st and the 2nd modification, which is no greater than 1 
second; so

7) the Date value equals to the 1st and the 2nd modification time, due 
to the 1 second resolution.

To summarise, if the client holds a response whose Last-Modified time is 
not a strong validator, then the response’s Date value must equal to the 
response’s Last-Modified time.

Conversely, if the response’s Date value does not equal to  (is greater 
than, in fact) the response’s Last-Modified time, then the response’s 
Last-Modified time becomes a strong validator.

So if the client holds a response whose Date value is greater than its 
Last-Modified time, then the response’s Last-Modified time is a strong 
validator.

In practice, due to the time difference issue, the Last-Modified time 
might appear to be less than the Date value, but eventually be resolved 
to Date value. In order to avoid such circumstance, the Last-Modified 
time is constrained to be at least 60 seconds before the Date value, so 
that the resolved Last-Modified time is always before the Date value, 
even taking the time difference into account.

To summarise again, if the client holds a response whose Last-Modified 
is at least 60 seconds before its Date value, then the Last-Modified 
time is a strong validator. The arbitrary 60 seconds can be replaced by 
a larger value, if necessary, of course.

I hope this will be useful to others who also feel confused about this 
statement.

Kind regards,

Michael

On 12/4/16 8:56 AM, Benedikt Christoph Wolters wrote:
> 2016-12-04 0:42 GMT+01:00 Michael Lee <michael.lee@zerustech.com>om>:
>> I don't understand why under the circumstance above, at least one of those responses would have a Date value equal to its Last-Modified time.
> Strictly speaking I assume the sentence might be slightly wrong.
> What might have been meant here is a scenario where two responses were
> send in the same second with identical Last-Modified values and at at
> least one Date value that is identical to the Last-Modified values.
>
>> And what's the point of ensuring a 60 seconds gap between the Last-Modified
>> time and Date?
> If the Date and Last-Modified headers are within 60 seconds, it is
> considered a weak validator, due to potential timing inconsistencies
> between the Last-Modified clock and Date clock.
>

-- 
Michael Lee / Managing Director / ZerusTech Ltd

Tel: +86 (21) 6107 3305

Mobile: +86 186 021 03818

Skype: zerustech

Email: michael.lee@zerustech.com

www.zerustech.com

Suite 9208
Building No. 9, 4361 HuTai Road
Shanghai
P.R.China
201906