Learn R Programming

ggimage (version 0.3.6)

get_image_cache_policy: Get or set the global image cache policy.

Description

Cache limits may also be supplied with options(): use ggimage.image_cache_capacity, ggimage.image_cache_ttl, ggimage.image_cache_bytes, and ggimage.image_cache_eviction for both caches, or the corresponding ggimage.image_cache_base_* and ggimage.image_cache_transform_* options independently. Byte limits are approximate object-size guardrails rather than process-memory measurements. The default capacity, TTL, and byte cap are infinite, preserving the historical unbounded cache. eviction is one of "lru", "fifo", or "none"; the last value disables capacity and byte eviction. clock is intended for deterministic tests and should return seconds or POSIXct.

Usage

get_image_cache_policy()

set_image_cache_policy( capacity = NULL, ttl = NULL, eviction = NULL, base_capacity = NULL, transform_capacity = NULL, base_ttl = NULL, transform_ttl = NULL, bytes = NULL, base_bytes = NULL, transform_bytes = NULL, clock = NULL )

Value

get_image_cache_policy() returns a policy list. The setter returns the previous policy invisibly.

Arguments

capacity, ttl

Optional shared capacity (number of entries) and TTL (seconds). NULL leaves the current option unchanged.

eviction

Optional eviction policy: "lru", "fifo", or "none".

base_capacity, transform_capacity

Cache-specific capacities.

base_ttl, transform_ttl

Cache-specific TTLs in seconds.

bytes

Optional shared estimated byte cap for each cache. NULL leaves the current option unchanged. This is an estimate, not a process-memory measurement; native image buffers may be larger than the estimate.

base_bytes, transform_bytes

Cache-specific estimated byte caps.

clock

Optional function used as the cache clock.