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:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Cache the contents of a web URL:

In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

Scope  (1)

Properties & Relations  (2)

See Also

LocalObject  CloudObject  URLDownload  $CacheBaseDirectory  Once

Introduced in 2016
(11.0)