LocalCache

LocalCache[CloudObject[uri]]

caches a cloud object in a local object.

LocalCache[URL[url]]

caches the contents of a url in a local object.

LocalCache[obj,LocalObject[name]]

caches the contents of obj in the specified local object.

Details

  • LocalCache[obj] chooses the name of the caching local object based on the name of obj.
  • Local caches by default are created under the directory given by $CacheBaseDirectory.
  • Reevaluating LocalCache[obj] fetches a new copy of obj only if necessary, or if no modification time is available.
  • LocalCache[URL[url]] uses URLSave to obtain the contents of url.

Examples

open allclose all

Basic Examples  (1)

Cache a cloud object:

Cache the contents of a web URL:

Scope  (1)

Specify the name of the local object to use as cache:

Properties & Relations  (2)

Create and cache a cloud object, then update its contents:

Update the cloud object:

The cache still contains the old version:

Update the cache:

List all existing cache objects under $CacheBaseDirectory:

Introduced in 2016
 (11.0)