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.
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
)
get_image_cache_policy() returns a policy list. The setter returns
the previous policy invisibly.
Optional shared capacity (number of entries) and TTL
(seconds). NULL leaves the current option unchanged.
Optional eviction policy: "lru", "fifo", or "none".
Cache-specific capacities.
Cache-specific TTLs in seconds.
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.
Cache-specific estimated byte caps.
Optional function used as the cache clock.