Cache class

Provides a local, in-memory cache.

Signature:

declare class Cache 

Remarks

The cache is attached to the Context and is used for both API resource caching and local resource caching (e.g. intermediate canvas and image results).

Constructors

Constructor

Modifiers

Description

(constructor)(options)

Create a cache instance.

Properties

Property

Modifiers

Type

Description

size

readonly

number

Get the number of items in the cache.

Methods

Method

Modifiers

Description

clean()

protected

Clean up expired keys.

clear()

Clear the cache.

delete(key)

Delete a key.

dependencies()

Get a list of dependencies.

destroy()

Destroy this cache instance.

dispose(owner)

Indicate that an owner was disposed.

entries()

Get a list of entries.

get(key)

Get a value by key.

has(key)

Check if the cache has a key.

require(owner, key)

Mark a key as required by an owner.

set(key, value, options)

Set a value by key.

set(data, options)

Set multiple values with an object.

unrequire(owner, key)

Mark a key as not longer required by an owner.

Get in touch

We'd love to learn more about your vision and how we can help.

PressPrivacyTermsSupportCopyright © 2024 Core3D, Inc. All Rights Reserved.