W3C home > Mailing lists > Public > public-web-perf@w3.org > August 2013

[Beacon] How beacon deals with failure.

From: Luke Blaney <luke.blaney@ft.com>
Date: Fri, 9 Aug 2013 16:06:20 +0100
Message-ID: <CAP+PQ_uSGJ96TbBu52KZeukZPcR9Kv8et8XL+yJfdzoG7XPXNQ@mail.gmail.com>
To: public-web-perf@w3.org
Hi,
    I've been having a look at the beacon specification.  It looks useful
for a number of cases, especially analytics.  However, one big concern I
have about the spec is the lack of definition regarding error handling.

XHR provides feedback to a webpage if a request fails, so it can decide
whether to retry immediately, queue the request for trying again later, or
immediately give up.  Obviously beacon has no mechanism for giving any
feedback to a webpage, so the browser must handle this logic itself.

The spec says "Developers should assume that any data transmitted using
this method will eventually be sent."  But it doesn't say whether it is
safe to assume that the data will eventually be received by the server.  If
a request fails, will the browser retry it?  And if so, how frequently?
I'd be particularly interested to know how each of the following use cases
would be handled:
1. The User Agent is offline (has no network connection).
2. The User Agent has a network connection, but the request times out
before getting a response.
3. The User Agent is behind a captive portal, so the response is a 302
redirect to another domain.
4. The server (or intermediary proxy) encounters an error and returns a 5xx.
5. The User Agent makes a request which is incorrect for some reason and
the server returns a 4xx.

I think it's important for these sort of things to be mentioned in the
spec, otherwise vendors may implement completely different behaviours for
each of these cases, resulting in skewed analytics for anyone tracking
which browsers use their site.

Regards,
     Luke Blaney

-- 
Luke Blaney
Labs developer, FT Labs [labs.ft.com | 0870 085 2038 | @ftlabs]

-- 

------------------------------
This email was sent by a company owned by Pearson plc, registered office at 
80 Strand, London WC2R 0RL.  Registered in England and Wales with company 
number 53723.
Received on Sunday, 11 August 2013 20:56:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:36 UTC