Skip to contents

Inspects a specific cache file to retrieve both the raw cached result and its associated metadata. This function is useful for debugging why a specific file was cached, checking the arguments used to generate it, or auditing creation times.

Usage

cacheInfo(file_path)

Arguments

file_path

A character string specifying the path to the .rds or .qs2 cache file.

Value

A list containing two elements:

value

The actual result returned by the cached function.

meta

A list of metadata describing the cache entry. Fields include:

  • fname: The name of the function that was cached.

  • args: A list of arguments passed to the function.

  • args_hash: The hash generated from the arguments.

  • created: A POSIXct timestamp of when the cache was created.

  • cache_file: The full path to this cache file.

  • cache_dir: The directory containing the cache.

If the file is a legacy cache file (created before metadata was supported), the meta list will contain a legacy = TRUE flag and minimal information.