Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

status

Summary

Returns the current status of the application cache, as given by the constants defined below.

Property of apis/appcache/ApplicationCacheapis/appcache/ApplicationCache

Syntax

Note: This property is read-only.

var result = ApplicationCache.status;

Return Value

Returns an object of type unsigned shortunsigned short

UNCACHED (numeric value 0)
The current webpage doesn’t use an application cache at this time.
IDLE (numeric value 1)
The current webpage’s application cache is the newest available, it’s content is not being updated or marked as obsolete.
CHECKING (numeric value 2)
The current webpage’s application cache is checking for an update.
DOWNLOADING (numeric value 3)
An update for the cached resources was found and is now being downloaded.
UPDATEREADY (numeric value 4)
The updated ressources have been newly redownloaded.
OBSOLETE (numeric value 5)
The current webpage’s application cache is marked as obsolete.

Examples

var appCache = window.applicationCache;

switch (appCache.status) {
  case appCache.UNCACHED: // UNCACHED == 0
    return 'UNCACHED';
    break;
  case appCache.IDLE: // IDLE == 1
    return 'IDLE';
    break;
  case appCache.CHECKING: // CHECKING == 2
    return 'CHECKING';
    break;
  case appCache.DOWNLOADING: // DOWNLOADING == 3
    return 'DOWNLOADING';
    break;
  case appCache.UPDATEREADY:  // UPDATEREADY == 4
    return 'UPDATEREADY';
    break;
  case appCache.OBSOLETE: // OBSOLETE == 5
    return 'OBSOLETE';
    break;
  default:
    return 'UKNOWN CACHE STATUS';
    break;
};

Related specifications

W3C ApplicationCache Specification
W3C Editor’s Draft

See also

Related articles

Off-line Storage

Attributions

  • Microsoft Developer Network: Article

  • Portions of this content come from HTML5Rocks! article