Contact emails
Spec
Proposed spec is at https://docs.google.com/document/d/1mh3uqyiCntp38jDcoECvKLyy0F1UIZPFafI2N910IQI/edit?usp=sharing
Summary
We want Chrome Apps to know certain characteristics of the current network connection, and be notified when those characteristics change. Originally we intended to implement this as a Chrome Apps API, but it seems more generally useful on the web, hence this proposal.
Motivation
ServiceWorker will (finally) enable an API to persistently cache resources on the client for offline and other use cases. However, once cached, the resources must also be manually updated. Question is, when? We are now entering the realm of applications which persist data between navigations and need to periodically update their assets.
The scheduling of when the update is triggered can have significant impact on battery and bandwidth usage of the device. All of the Android tips on optimizing networking fetching / prefetch are directly applicable. Further, smart prefetch is not just an optimization, but can also be a differentiating feature - e.g. YouTube prefetch was a runaway success.
Combination of ServiceWorker + NetInfo allows the application to optimize when and how much data is prefetched, when resources are updated, etc.
Compatibility Risk
Currently already two versions of this API exist in the wild, v1 and v2 of the NetInfo API. For good reasons neither of these is currently implemented in blink. This proposal attempts to solve the problems with these existing versions, but since this is clearly a hard problem to get right, the idea is to initially only expose this new API to Chrome Apps while we work out any details/things that might not work in practice.
Ongoing technical constraints
None.
Will this feature be supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS and Android)?
The implementation will be different for every platform, but the goal is to support all five platforms.
OWP launch tracking bug?
No (although I'm guessing there should be one)
Link to entry on the feature dashboard
Not sure if there should be one?
Requesting approval to ship?
No. The feature will be developed behind a runtime flag, although we might want to expose this feature to chrome apps before being exposed by default for websites.
Spec
Proposed spec is at https://docs.google.com/document/d/1mh3uqyiCntp38jDcoECvKLyy0F1UIZPFafI2N910IQI/edit?usp=sharing
That looks significantly better than the current NetInfo API spec.Spec
Proposed spec is at https://docs.google.com/document/d/1mh3uqyiCntp38jDcoECvKLyy0F1UIZPFafI2N910IQI/edit?usp=sharing
One nit - IMO the word "cost" for "how much bandwidth allowance does the user have left" may cause author confusion. Maybe "bandwidthLeft"?Are there any plans to bring this improved API to the device-api WG?
In summary, we don't have any immediate plans to bring this API to the device-api WG, but the reason we're experimenting with this implementation approach is to make it easier to do that in the future.
I have (standing) concerns regarding the use-cases this API is trying to address, which I've discussed with Ilya plenty of times in the past.The use-case you propose is for Service Workers to know when they should synchronize their data, but I think it would be a lot better for the user agent to heuristically determine the ideal synchronization time based on when the user is likely to use an application, as well as the network conditions, battery status, user preferences and so on.
Given the lack of connection type in the API, I'm curious what mechanism we intend developers to use to handle mobile energy consumption by the radio? I in general see two options, which aren't necessarily mutually exclusive:(1) Expose information about the connection type and let developers try to control radio usage within their app.
On Thu, Dec 5, 2013 at 11:19 AM, William Chan (陈智昌) <will...@chromium.org> wrote:
Given the lack of connection type in the API, I'm curious what mechanism we intend developers to use to handle mobile energy consumption by the radio? I in general see two options, which aren't necessarily mutually exclusive:
(1) Expose information about the connection type and let developers try to control radio usage within their app.I think this is most promising; it gives frameworks a way to do the Right Thing (TM) transparently to app.
There's an associated wrinkle: all of this seems to assume single-path TCP/UDP. In a world where multi-path is available to apps, having these properties be single-valued seems like it'd require some sort of unseemly "smushing"; either overloading the meanings or creating concatenated properties. Perhaps better to pre-epmtively make these arrays that are single-valued MOST of the time?
On Tue, Dec 3, 2013 at 8:29 AM, Peter Beverloo <pe...@chromium.org> wrote:
I have (standing) concerns regarding the use-cases this API is trying to address, which I've discussed with Ilya plenty of times in the past.The use-case you propose is for Service Workers to know when they should synchronize their data, but I think it would be a lot better for the user agent to heuristically determine the ideal synchronization time based on when the user is likely to use an application, as well as the network conditions, battery status, user preferences and so on.The way this would be communicated to the SW would be with an event. Nothing in this API precludes the UA giving the app hints about when to sync.
On Thu, Dec 5, 2013 at 11:19 AM, William Chan (陈智昌) <will...@chromium.org> wrote:
Given the lack of connection type in the API, I'm curious what mechanism we intend developers to use to handle mobile energy consumption by the radio? I in general see two options, which aren't necessarily mutually exclusive:(1) Expose information about the connection type and let developers try to control radio usage within their app.I think this is most promising; it gives frameworks a way to do the Right Thing (TM) transparently to app.There's an associated wrinkle: all of this seems to assume single-path TCP/UDP. In a world where multi-path is available to apps, having these properties be single-valued seems like it'd require some sort of unseemly "smushing"; either overloading the meanings or creating concatenated properties. Perhaps better to pre-epmtively make these arrays that are single-valued MOST of the time?
Do we have any use case scenarios for these APIs? I'm curious if there's a subset of stuff that may be better suited to a different API. Not saying we shouldn't expose this stuff, but I wonder if we think we already have a good idea on how such an API would be used.
I'd like to avoid getting hung up on the metered and bandwith discussions. If we make this API extensible, vendors can provide best-guesses. The v3 outline gives us a strong starting point that lets apps doing decent heuristics.On an API-design front, I suggest we should be providing signals for anything we'd be using in a "smart" api (e.g., "background sync") to be making decisions about when it's safe to sync, not just the eventual decision as it'll largely be observable from such smart APIs that the runtime thinks one class of things is true and not another.Good layering demands we explain ourselves. I suggest we start at V3 and add metering/bandwidth guesses later.
Contact emails
Spec
Proposed spec is at https://docs.google.com/document/d/1mh3uqyiCntp38jDcoECvKLyy0F1UIZPFafI2N910IQI/edit?usp=sharing
Summary
We want Chrome Apps to know certain characteristics of the current network connection, and be notified when those characteristics change. Originally we intended to implement this as a Chrome Apps API, but it seems more generally useful on the web, hence this proposal.
Motivation
ServiceWorker will (finally) enable an API to persistently cache resources on the client for offline and other use cases. However, once cached, the resources must also be manually updated. Question is, when? We are now entering the realm of applications which persist data between navigations and need to periodically update their assets.
The scheduling of when the update is triggered can have significant impact on battery and bandwidth usage of the device. All of the Android tips on optimizing networking fetching / prefetch are directly applicable. Further, smart prefetch is not just an optimization, but can also be a differentiating feature - e.g. YouTube prefetch was a runaway success.
Combination of ServiceWorker + NetInfo allows the application to optimize when and how much data is prefetched, when resources are updated, etc.
Compatibility Risk
Currently already two versions of this API exist in the wild, v1 and v2 of the NetInfo API. For good reasons neither of these is currently implemented in blink. This proposal attempts to solve the problems with these existing versions, but since this is clearly a hard problem to get right, the idea is to initially only expose this new API to Chrome Apps while we work out any details/things that might not work in practice.
Ongoing technical constraints
None.
Will this feature be supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS and Android)?
The implementation will be different for every platform, but the goal is to support all five platforms.
OWP launch tracking bug?
No (although I'm guessing there should be one)
Link to entry on the feature dashboard
Not sure if there should be one?