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 URLDownload 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:

Wolfram Research (2016), LocalCache, Wolfram Language function, https://reference.wolfram.com/language/ref/LocalCache.html.

Text

Wolfram Research (2016), LocalCache, Wolfram Language function, https://reference.wolfram.com/language/ref/LocalCache.html.

CMS

Wolfram Language. 2016. "LocalCache." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LocalCache.html.

APA

Wolfram Language. (2016). LocalCache. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LocalCache.html

BibTeX

@misc{reference.wolfram_2024_localcache, author="Wolfram Research", title="{LocalCache}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/LocalCache.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_localcache, organization={Wolfram Research}, title={LocalCache}, year={2016}, url={https://reference.wolfram.com/language/ref/LocalCache.html}, note=[Accessed: 21-December-2024 ]}