Skip to contents

This object provides methods to download files and cache them on disk.

Usage

download_cache

Format

A list of methods:

  • $get(url, type, handler) downloads a URL, caches it, and returns the file content according to the value of type (possible values: "text" means the text content; "base64" means the base64 encoded data; "raw" means the raw binary content; "auto" is the default and means the type is determined by the content type in the URL headers). Optionally a handler function can be applied to the content.

  • $list() gives the list of cache files.

  • $summary() gives a summary of existing cache files.

  • $remove(url, type) removes a single cache file.

  • $purge() deletes all cache files.

Examples