Skip to contents

Removes the stored responses and resets the session counters. The directory itself is left in place, and so is anything in it that is not a cache entry (a gr_read_many() store, your own files): only files in the cache's own layout are removed.

Usage

hr_cache_clear(cache)

Arguments

cache

An hr_cache().

Value

The number of entries removed, invisibly.

Examples

cache <- hr_cache(file.path(tempdir(), "harnessr-clear-cache"))
cl <- hr_cache_client(hr_mock_client(function(m, p) "hi"), cache)
invisible(hr_call(cl, "something"))
hr_cache_clear(cache)
hr_cache_stats(cache)$entries
#> [1] 0