cachedURLs

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the cachedURLs
cachedURLs()
Synonymscachedurl
Associationsinternet library
Summary

Returns a list of the URLs that have been downloaded and copied to the cache using the load command.

Introduced1.0
Changes

The cachedURLs function became part of the Internet library in version 1.1. In previous versions, it was not a library function.

OSmac, windows, linux, web
Platformsdesktop, server
Example
the cachedURLs
if myURL is not among the lines of the cachedURLs then load myURL
Values
NameTypeDescription
return

The cachedURLs function returns a list of currently loaded URLs, one per line.

RelatedKeyword: URL, line
Glossary: LiveCode custom library, return, handler, download, cache, Standalone Application Settings, URL, standalone application, command, load
Command: unload, load
Function: files, libURLErrorData, URLStatus, cachedURLs
Library: Internet library
Control Structure: function
Securitynetwork
Description

Use the cachedURLs function to determine which files have been downloaded and are currently in the cache. A cached URL can be accessed more quickly than one that is not cached.

The cachedURLs function includes all URLs that you have successfully loaded with the load command. If an unsuccessful attempt has been made to load a URL, it does not appear in the cachedURLs. Only URLs whose URLStatus is "cached" appear in the cachedURLs.

Cached files consume memory. To release this memory after you are finished with a URL, use the unload command to remove it from the cache. You can use this handler to unload all URLs:

on unloadAll
    repeat for each line tThisURL in the cachedURLs
        unload URL tThisURL
    end repeat
end unloadAll

Important: The cachedURLs function is part of the Internet library. To ensure that the function works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Internet" script library is selected.

Tagsnetworking