RemoteStorage.Caching

Holds/manages caching configuration.

Caching strategies

For each subtree, you can set the caching strategy to ‘ALL’, ‘SEEN’ (default), and ‘FLUSH’.

  • ’ALL’ means that once all outgoing changes have been pushed, sync will start retrieving nodes to cache pro-actively.  If a local copy exists of everything, it will check on each sync whether the ETag of the root folder changed, and retrieve remote changes if they exist.
  • ’SEEN’ does this only for documents and folders that have been either read from or written to at least once since connecting to the current remote backend, plus their parent/ancestor folders up to the root (to make tree-based sync possible).
  • ’FLUSH’ will only cache outgoing changes, and forget them as soon as they have been saved to remote successfully.
Summary
RemoteStorage.CachingHolds/manages caching configuration.
Functions
setConfigure caching for a given path explicitly.
enableEnable caching for a given path.
disableDisable caching for a given path.
onActivateSet a callback for when caching is activated for a path.
checkPathRetrieve caching setting for a given path, or its next parent with a caching strategy set.
resetReset the state of caching by deleting all caching information.

Functions

set

set: function (path,
strategy)

Configure caching for a given path explicitly.

Not needed when using enable/disable.

Parameters

pathPath to cache
strategyCaching strategy.  One of ‘ALL’, ‘SEEN’, or ‘FLUSH’.

Example

remoteStorage.caching.set('/bookmarks/archive')

enable

enable: function (path)

Enable caching for a given path.

Uses caching strategy ‘ALL’.

Parameters

pathPath to enable caching for

disable

disable: function (path)

Disable caching for a given path.

Uses caching strategy ‘FLUSH’ (meaning items are only cached until successfully pushed to the remote).

Parameters

pathPath to disable caching for

onActivate

onActivate: function (cb)

Set a callback for when caching is activated for a path.

Parameters

callbackCallback function

checkPath

checkPath: function (path)

Retrieve caching setting for a given path, or its next parent with a caching strategy set.

Parameters

pathPath to retrieve setting for

reset

reset: function ()

Reset the state of caching by deleting all caching information.

set: function (path,
strategy)
Configure caching for a given path explicitly.
enable: function (path)
Enable caching for a given path.
disable: function (path)
Disable caching for a given path.
onActivate: function (cb)
Set a callback for when caching is activated for a path.
checkPath: function (path)
Retrieve caching setting for a given path, or its next parent with a caching strategy set.
reset: function ()
Reset the state of caching by deleting all caching information.
Close