Skip to contents

Clears the memoised caches used by input validation functions in the cvdprevent package, such as m_get_valid_time_period_ids() and m_get_valid_tag_ids().

Usage

cvd_clear_cache()

Value

Invisibly returns TRUE after clearing all relevant caches.

Details

The cvdprevent package validates user inputs like time_period_id and tag_id by retrieving valid values from an external API. To improve responsiveness and reduce unnecessary API calls, these values are cached using memoisation and remain valid for up to 7 days.

This function clears any existing caches, forcing the validation functions to re-fetch fresh data from the API. This is especially useful when new audit data has been published since the last cache was created, and stale values are causing validation errors (e.g., an apparently invalid time_period_id that is actually valid in the latest dataset).

Examples

# clear all caches used to validate user inputs
cvd_clear_cache()
#> Warning: One or more functions in `memoised_fns` are not memoised.
#> Warning: One or more functions in `memoised_fns` are not memoised.