memoise::cache_filesystem() stores all caches in a single directory which degrades filesystem performance when you have a large number of cache files. This function adds a second level subdirectory structure to help mitigate this issue. Future versions will enable the caller to choose the number of levels. This works with all digest::digest() hashing algorithms.

cache_fs2(path, algo = "xxhash64", compress = FALSE)

Arguments

path

Directory in which to store cached items.

algo

The hashing algorithm used for the cache, see digest::digest() for available algorithms.

Details

Two additional functions are provided in slots in the returned list:

  • location() which will return the path to the cache directory

  • size() which will compute and return the size of the cache (in bytes)