Improvements / Changes over the Specification:
-
now-online
andnow-offline
transition events fired at the cache host level (sodocument
for my library) when a connectivity transition has been detected.BEWARE: these are very similar to the "online" and "offline" events introduced in Application Cache, described here on MDC and here in HTML5. For now, I will not transition to these events to prevent duplicate invocations. Developers that wish to use both, may simply register the same handler to both events, and be aware of the potential for duplication.
function handler() { ... } document.addEventListener('online', handler, false); document.addEventListener('now-online', handler, false);
-
DataCache.getManagedItems
returns an Array of all the items stored in the particular cache, with the form:{ uri: <string>, item: <CacheItem> }
-
eachModificationSince
will go back through everything if thelowVersion
is null. -
when the item callback for
eachModificationSince
is triggered the library provides a second parameter with the resolved URI of the item. This is becauseuri
is missing from theCacheItem
IDL. -
navigator.removeRegisteredOfflineHandlers
removes all registered local server handlers. -
A standard set of Http Status values in
Http.Status
. For example:response.setStatus(200, Http.Status[200]); // "OK"
-
window.openNewDataCache()
forces creating a new data cache with a new version number. This uses the same algorithm as creating a new data cache for an online transation.