class

Bakelite::Transform::Cache

Inherits Reference < Object

Content-addressable cache manager for compile-time asset transformations. Caches the results of expensive external tool executions in .bakelite/cache/ keyed by SHA256(file_content + command_string), eliminating repeated process invocations.

Constructors

new(cache_dir : Path | String = ".bakelite/cache")
Source

Instance methods

cache_dir
Source
cache_file_path(key : String) : Path

Full path to the cache entry file.

Source
clear

Clears all entries in the cache directory.

Source
compute_key(input_data : Bytes | String, command : String) : String

Computes a deterministic cache key from input bytes and transform command string.

Source
get?(key : String) : Bytes | Nil

Retrieves cached output bytes, returning nil on cache miss.

Source
has_key?(key : String) : Bool

Checks if a transformed result exists in cache.

Source
put(key : String, data : Bytes | String) : Nil

Stores transformed output bytes into cache.

Source