purge_with_opts

Functionin simplefastly 0.13.1View source
fn purge_with_opts(key: impl Into<CacheKey>, opts: PurgeOptions) -> Result<(), CacheError>

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())?;

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

purge("my_key")?;
Example global-scoped purge
purge_with_opts("my_key", PurgeOptions::global_scope())?;

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.

Parameters

key: impl Into<CacheKey>
opts: PurgeOptions

Returns