<doc>
  <legacy_id>2059</legacy_id>
  <name>cachedURLs</name>
  <type>function</type>
  <syntax>
    <example>the cachedURLs</example>
    <example>cachedURLs()</example>
  </syntax>
  <library>Internet library</library>
  <objects>
  </objects>
  <synonyms>
    <synonym>cachedURL</synonym>
  </synonyms>
  <classification>
    <category>Networks &amp; Communication</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <function tag="libURLErrorData">libURLErrorData Function</function>
    <command tag="load">load Command</command>
    <command tag="unload">unload Command</command>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
    <changed version="1.1.1"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
    <network/>
  </security>
  <summary><glossary tag="return">Returns</glossary> a list of the <glossary tag="URL">URLs</glossary> that have been <glossary tag="download">downloaded</glossary> and copied to the <glossary tag="cache">cache</glossary> using the <command tag="load">load</command> <glossary tag="command">command</glossary>.</summary>
  <examples>
    <example>the cachedURLs</example>
    <example>if myURL is not among the lines of the cachedURLs then load myURL</example>
  </examples>
  <description>
    <p>Use the <b>cachedURLs</b> <control_st tag="function">function</control_st> to determine which <function tag="files">files</function> have been <glossary tag="download">downloaded</glossary> and are currently in the <glossary tag="cache">cache</glossary>. A <glossary tag="cache">cached</glossary> <keyword tag="URL">URL</keyword> can be accessed more quickly than one that is not <glossary tag="cache">cached</glossary>.</p><p/><p><b>Value:</b></p><p>The <b>cachedURLs</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a list of currently <glossary tag="load">loaded</glossary> <glossary tag="URL">URLs</glossary>, one per <keyword tag="line">line</keyword>.</p><p/><p><b>Comments:</b></p><p>The <b>cachedURLs</b> <control_st tag="function">function</control_st> includes all <glossary tag="URL">URLs</glossary> that you have successfully <glossary tag="load">loaded</glossary> with the <command tag="load">load</command> <glossary tag="command">command</glossary>. If an unsuccessful attempt has been made to <command tag="load">load</command> a <keyword tag="URL">URL</keyword>, it does not appear in the <function tag="cachedURLs">cachedURLs</function>. Only <glossary tag="URL">URLs</glossary> whose <function tag="URLStatus">URLStatus</function> is "cached" appear in the <b>cachedURLs</b>.</p><p/><p>Cached files consume memory. To release this memory after you are finished with a URL, use the <b>unload</b> <glossary tag="command">command</glossary> to remove it from the <glossary tag="cache">cache</glossary>. You can use this <glossary tag="handler">handler</glossary> to unload all <glossary tag="URL">URLs</glossary>:</p><p/><p>  on unloadAll</p><p>    repeat for each line thisURL in the cachedURLs</p><p>      unload URL thisURL</p><p>    end repeat</p><p>  end unloadAll</p><p/><p><img src="202653"/> <b>Important!</b> The <b>cachedURLs</b> <control_st tag="function">function</control_st> is part of the <glossary tag="Internet library">Internet library</glossary>. To ensure that the <control_st tag="function">function</control_st> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure "Internet Library" is selected in the list of script libraries.</p><p/><p><b>Changes:</b></p><p>The <b>URLStatus</b> <control_st tag="function">function</control_st> became part of the <glossary tag="Internet library">Internet library</glossary> in version 1.1. In previous versions, it was not a library function.</p><p/><p>Starting with version 1.1.1, URLs that were not successfully downloaded do not appear in the <b>cachedURLs</b>. In previous versions, all <glossary tag="URL">URLs</glossary> for which the <command tag="load">load</command> <glossary tag="command">command</glossary> was issued appeared in the <b>cachedURLs</b>, even if they were not successfully <glossary tag="download">downloaded</glossary>.</p>
  </description>
</doc>