Re: [Webpush] Time to live for push messages

Costin Manolache <costin@gmail.com> Sat, 21 February 2015 23:26 UTC

Return-Path: <costin@gmail.com>
X-Original-To: webpush@ietfa.amsl.com
Delivered-To: webpush@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0D62C1A0125 for <webpush@ietfa.amsl.com>; Sat, 21 Feb 2015 15:26:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=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 PvZT09Z87aiY for <webpush@ietfa.amsl.com>; Sat, 21 Feb 2015 15:26:32 -0800 (PST)
Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 62EF51A0121 for <webpush@ietf.org>; Sat, 21 Feb 2015 15:26:32 -0800 (PST)
Received: by iecrd18 with SMTP id rd18so15816724iec.8 for <webpush@ietf.org>; Sat, 21 Feb 2015 15:26:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5xxUvC0dIHSD+FC8eLlL/bkm9ULNGSg6GYXYQirLwWs=; b=pdX8hsUzOXoW8PCeSZ7TpuihIaQaZrPD8Vv+ZUoIfXlibWJx7sUjmzIaA5p5/fJksv FQt/3K+fAseS2D/k1+fP8cLNVpczS9kIiDUU73HVlSK4Af4EiiUkxGL0tY4HyhNSot4m uXUT4kVQ56MTxMJkiZ9IDHEswEAH2Bj1R2FJHeKAAJ1L739xMeYHIf6m63fXZQyw0OP4 Mgt9TNtia9/65U8qLRfu/GhQPLbYEfEmXo8haDsTRXLkvgIaLSsxEj7U5r2Qv2B6hOfw t7DBFUT409stgNIG+7WBzeGQWjTUyG/rQhpbnEDz1OxkRCVuFeRvzgm23h7HICyRuN1R h+6g==
MIME-Version: 1.0
X-Received: by 10.42.150.130 with SMTP id a2mr4665399icw.69.1424561191546; Sat, 21 Feb 2015 15:26:31 -0800 (PST)
Received: by 10.64.86.135 with HTTP; Sat, 21 Feb 2015 15:26:31 -0800 (PST)
In-Reply-To: <CABkgnnUZEVazYFg0bv5a1gyjuRLgxXQ7NiPpy-fKXPo7SdNyag@mail.gmail.com>
References: <CABkgnnX6rGfY99YX1RC+mxwAsVw0=gC1wjyZGCpZ3h+QQntehA@mail.gmail.com> <CAP8-FqnORx-Fd5E4vR0CWN=n8JHK81iCwdqAovZr5276ADWDVQ@mail.gmail.com> <CABkgnnUZEVazYFg0bv5a1gyjuRLgxXQ7NiPpy-fKXPo7SdNyag@mail.gmail.com>
Date: Sat, 21 Feb 2015 15:26:31 -0800
Message-ID: <CAP8-Fq=sZmak-UxZX6ROZ0=aW0rx3PTwGGu_eZGAFfHHBfvUqw@mail.gmail.com>
From: Costin Manolache <costin@gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Content-Type: multipart/alternative; boundary="90e6ba21220bc87570050fa17fde"
Archived-At: <http://mailarchive.ietf.org/arch/msg/webpush/CrYa04Cx3fzixhJ6Rhv_4A3VW7Y>
Cc: "webpush@ietf.org" <webpush@ietf.org>
Subject: Re: [Webpush] Time to live for push messages
X-BeenThere: webpush@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Discussion of potential IETF work on a web push protocol <webpush.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/webpush>, <mailto:webpush-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/webpush/>
List-Post: <mailto:webpush@ietf.org>
List-Help: <mailto:webpush-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/webpush>, <mailto:webpush-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 21 Feb 2015 23:26:35 -0000

On Sat, Feb 21, 2015 at 2:33 PM, Martin Thomson <martin.thomson@gmail.com>
wrote:

> On 22 February 2015 at 06:53, Costin Manolache <costin@gmail.com> wrote:
> > For option A: the format in RFC4918 is "Infinite | Second-1234".
> > Unless 'infinite' is defined to be few weeks - it is going to be hard to
> > support.
> > I think using seconds instead of absolute value is very good.
>
> It is customary for the server to have the ultimate authority on what
> the timeout actually is.  A requested timeout of Infinite is always
> going to be shorter anyway, and if the client asks for a month and the
> server can only do a minute, then it will be a minute.
>

I agree - my comment was more on the slightly strange syntax - "Second-"
prefix and "Infinite" constant are a bit odd compared with other ways
to represent time.


>
> The only question there is how much value there is in having the
> server notify the client about the actual timeout.  I guess if a
> server refuses to store for a particular duration, a client could be
> forced to retry for that duration.
>

Server can include 'max ttl' in the response if it rejects too long time,
so client can use max ttl. Or accept it with a shorter ttl, but include the
shorter ttl in response.


>
> > RFC3261 (SIP) uses ';ttl=12' as a URI parameter - without the constant
> > "Second-".
> > I would personally prefer this option.
>
> The format is unnecessarily clunky, I agree.
>

Another benefit of having ttl as URL param - or in payload - is for the
case message needs to go trough multiple servers.


>
> > "Expires" header is another option.
>
> I considered that at some length and rejected it for two reasons:
>
> Expires only has defined semantics related to the cacheability of HTTP
> responses.  Using Expires in a request context, even for a PUT (maybe
> even especially for a PUT) is well outside its original definition.
>
> Also, Expires uses an absolute time and clock skew has proven to be a
> major issue.  In theory, an absolute time can be more precise, but
> most uses for a TTL are on short timescales where clock skew can
> dominate.  At least with a relative time, transit times can be
> accounted for.
>

Agreed - relative time in seconds sounds good, just
URL param vs Header vs payload.




>
> > An important decision is if the ttl (and other timestamps)
> > need to be sent to the device and authenticated or it is going to
> > be dropped or modified during transport.
>
> As I alluded to in my first email, I think that the primary value of a
> TTL parameter is where the push service uses the value.  Once the push
> hits the user agent, it's value is greatly diminished.
>
> Of course, there is nothing wrong with having the push message itself
> contain time-based information that is consumed by the application.
>

One use case is a message that goes trough multiple servers - and may
be gated on the client as well. For example message is for a multi-profile
UA - and it gets delivered to the client machine but it can't be delivered
to
the intended profile ( stopped users on android for example ). Or in
some cases the UA may display a notification before delivering the message
to the app - if TTL expires it may drop the notification and message.

The sender would include ttl=60, push server stores the
message and delivers it after 20 seconds - than the forwarded message would
have the remaining ttl=40 (or ttl=60, 'delay=20'). The message may have
to wait on either client or intermediary  server.

>
> > Another complication may be the case the message is
> > forwarded multiple times, there are few cases where
> > this may become necessary.
>
> If you are required to forward the message, that's an internal detail
> of the push service and I'd expect that you would account for any
> elapsed time there.  You could, for instance, convert a relative time
> into an absolute time for internal consumption, knowing that your
> servers have good time synchronization.
>

That's easy if it's internal forwarding, I was thinking of the case of
forwarding to
a different push provider. We should consider the case - given the
complicated
world of mobile.

Costin