When you use a ResourceObject
, it is automatically cached locally in a dedicated directory in your $DefaultLocalBase
. The first time you retrieve the content of the resource object - data in this case - it is also cached locally.
Clear local cache
In[94]:= ResourceRemove[ResourceObject["General Topology EntityStore"]]
Out[94]= "15ef2946-102d-4814-b321-77286cfc41a6"
Download
In[97]:= AbsoluteTiming[ByteCount@ResourceData["General Topology EntityStore"]]
Out[97]= {0.926332, 13423880}
Reuse the cached version
In[98]:= AbsoluteTiming[ByteCount@ResourceData["General Topology EntityStore"]]
Out[98]= {0.036689, 13423880}
In a new session
In[99]:= Quit
In[1]:= ResourceData; (* there is some initialization that would inflate the timing *)
The first use is slightly slower because it resolves the resource name and validates the metadata cache.
In[2]:= AbsoluteTiming[ByteCount@ResourceData["General Topology EntityStore"]]
Out[2]= {0.429235, 13423880}
In[3]:= AbsoluteTiming[ByteCount@ResourceData["General Topology EntityStore"]]
Out[3]= {0.034282, 13423880}
Keep in mind this cache is on-disk. There is not automatically a kernel-level cache, but you can use Once[ResourceData[...]]
to effectively cache in the kernel session.
If you want more control (formatting, file location, etc.) then of course you can use standard Export
operations directly on the data.