Function fastly::cache::simple::purge_with_opts

source ·
pub fn purge_with_opts(
    key: impl Into<CacheKey>,
    opts: PurgeOptions
) -> Result<(), CacheError>
Expand description

Purge the entry associated with the given cache key.

The PurgeOptions argument determines the scope of the purge operation.

§Note

Purged values may persist in cache for a short time (~150ms or less) after this function returns.

§Argument type conversion

See the From impls for Bytes to see which types can be used as a key.

§Example POP-scoped purge

purge_with_opts("my_key", PurgeOptions::pop_scope()).unwrap();

Note that this is the default behavior, and is therefore equivalent to:

purge("my_key").unwrap();

§Example global-scoped purge

purge_with_opts("my_key", PurgeOptions::global_scope()).unwrap();

This purging mode is subject to the same rate limits as other forms of global purging on Fastly. You should use POP scope where possible, and can contact support@fastly.com with questions if you encounter rate limiting issues.