Deletes oldest files until cache size is below the threshold size. Additionally, users can specify a maximum age in days to delete all files older than the threshold, which can speed up file purge in large stores. Setting either age and threshold to 0 will purge everything from cache.

purge_cache(threshold = "1G", age = Inf, dir = content_dir())



Threshold size, accepts [fs::fs_bytes] notation.


Maximum age in days


the path we should use for permanent / on-disk storage of the registry. An appropriate default will be selected (also configurable using the environmental variable CONTENTID_HOME), if not specified.


invisibly returns directory path


Default behavior will keep contentid's local store size below 1 GB. Note that contentid functions do not automatically call purge_cache(), this must be handled by user workflows.