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

gr_cache_clear(cache)

Arguments

cache

A gr_cache().

Value

The number of entries removed, invisibly.

Examples

cache <- gr_cache(file.path(tempdir(), "harnessr-clear-cache"))
cl <- gr_cache_client(gr_mock_client(function(m, p) "hi"), cache)
invisible(gr_call(cl, "something"))
gr_cache_clear(cache)
gr_cache_stats(cache)$entries
#> [1] 0