({{, (RefLink[LocalCache, paclet:ref/LocalCache])[(RefLink[CloudObject, paclet:ref/CloudObject])[uri]] 
caches a cloud object in a local object.}, {, (RefLink[LocalCache, paclet:ref/LocalCache])[(RefLink[URL, paclet:ref/URL])[url]]
caches the contents of a url in a local object.}, {, (RefLink[LocalCache, paclet:ref/LocalCache])[obj,(RefLink[LocalObject, paclet:ref/LocalObject])[name]]
caches the contents of obj in the specified local object.}})

OpenersNotesSection(Spacer1)Details

(RefLink[LocalCache, paclet:ref/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 (RefLink[$CacheBaseDirectory, paclet:ref/$CacheBaseDirectory]).

Reevaluating (RefLink[LocalCache, paclet:ref/LocalCache])[obj] fetches a new copy of obj only if necessary, or if no modification time is available.

(RefLink[LocalCache, paclet:ref/LocalCache])[(RefLink[URL, paclet:ref/URL])[url]] uses (RefLink[URLSave, paclet:ref/URLSave]) to obtain the contents of url.

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Cache a cloud object:

cache=LocalCache[CloudObject[MouseOver]]

Get[cache]

Cache the contents of a web URL:

img=LocalCache[URL["http://www.wolfram.com/spikey/img/spikey.png"]]

Import[img]

OpenersExampleSection1(Spacer1)Scope  (1)

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

cache=LocalCache[CloudObject[MouseOver],
LocalObject["answer"]]

OpenersExampleSection3(Spacer1)Properties & Relations  (2)

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

Put[42,CloudObject["question"]];

cache=LocalCache[CloudObject["question"]];

Update the cloud object:

Put[43,CloudObject["question"]];

The cache still contains the old version:

Get[cache]

Update the cache:

cache=LocalCache[CloudObject["question"]];

Get[cache]

List all existing cache objects under (RefLink[$CacheBaseDirectory, paclet:ref/$CacheBaseDirectory]):

LocalObjects[$CacheBaseDirectory]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[LocalObject, paclet:ref/LocalObject])  ▪  (RefLink[CloudObject, paclet:ref/CloudObject])  ▪  (RefLink[URLDownload, paclet:ref/URLDownload])  ▪  (RefLink[$CacheBaseDirectory, paclet:ref/$CacheBaseDirectory])  ▪  (RefLink[Once, paclet:ref/Once])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Wolfram Data Repository, paclet:guide/WolframDataRepository])}, {▪(RefLinkPlain[Persistent Storage, paclet:guide/PersistentStorage])}, {▪(RefLinkPlain[Wolfram Function Repository, paclet:guide/WolframFunctionRepository])}, {▪(RefLinkPlain[Local Objects, paclet:guide/LocalObjects])}, {▪(RefLinkPlain[Wolfram Resource System, paclet:guide/WolframResourceSystem])}})}})