Safari Developer Library

Developer

DOMApplicationCache Class Reference

Options
Deployment Target:

On This Page

DOMApplicationCache

A DOMApplicationCache object is used to store resources—such as, HTML, JavaScript, CSS, and images—locally. This allows your web application to continue running offline when there is no network connection. The cache persists after Safari exits, so it can be used by multiple browser sessions. There is one application cache per browsing context.

  • status Property

    The current status of the application cache. One of the values described in "Constants.”

    Declaration

    readonly attribute unsigned short status;

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • onchecking Property

    Sent when the cache update process begins.

    Declaration

    attribute EventListener onchecking;

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • onerror Property

    Sent when an error occurs.

    Declaration

    attribute EventListener onerror;

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • onnoupdate Property

    Sent when the update process finishes but the manifest file does not change.

    Declaration

    attribute EventListener onnoupdate;

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • Sent when the update process begins downloading resources in the manifest file.

    Declaration

    attribute EventListener ondownloading;

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • onprogress Property

    Sent when each resource in the manifest file begins to download.

    Declaration

    attribute EventListener onprogress;

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • Sent when there is an existing application cache, the update process finishes, and there is a new application cache ready for use.

    Declaration

    attribute EventListener onupdateready;

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • oncached Property

    Sent when the update process finishes for the first time—that is, the first time an application cache is saved.

    Declaration

    attribute EventListener oncached;

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • Forthcoming

    Declaration

    void add(in DOMString uri) raises(DOMException);

    Discussion

    Forthcoming

  • Manually triggers the update process.

    Declaration

    void update() raises(DOMException);

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • Replaces the active cache with the latest version.

    Declaration

    void swapCache() raises(DOMException);

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

Constants

Constants that indicate the status of the application cache.

Constants

  • UNCACHED

    1. const unsigned short UNCACHED = 0;

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • IDLE

    1. const unsigned short IDLE = 1;

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • CHECKING

    1. const unsigned short CHECKING = 2;

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • DOWNLOADING

    1. const unsigned short DOWNLOADING = 3;

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.

  • UPDATEREADY

    1. const unsigned short UPDATEREADY = 4;

    Available in Safari 4.0 and later.

    Available in iOS 2.2 and later.