Cache

A simple caching system, used internally by FileLoader.

Examples

WebGL / geometry / text
WebGL / interactive / instances / gpu
WebGL / loader / ttf

Usage

To enable caching across all loaders that use FileLoader, set

v3d.Cache.enabled = true.

Properties

.enabled : Boolean

Whether caching is enabled. Default is false.

.files : Object

An object that holds cached files.

Methods

.add (key : String, file) : null

key — the key to reference the cached file by.
file — The file to be cached.

Adds a cache entry with a key to reference the file. If this key already holds a file, it is overwritten.

.get (key : String) : null

key — A string key

Get the value of key. If the key does not exist undefined is returned.

.remove (key : String) : null

key — A string key that references a cached file.

Remove the cached file associated with the key.

.clear () : null

Remove all values from the cache.

Source

For more info on how to obtain the source code of this module see this page.