purge

Functionin simplecompute-sdk-cpp 0.7.0

Purge the entry associated with the given cache key.

To configure the behavior of the purge, such as to purge globally rather than within the POP, use purge_with_opts().

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

Example:

Overload 1 of 2

tl::expected<void, CacheError> fastly::cache::simple::purge(std::span<const std::uint8_t> key)
View source

Purge the entry associated with the given cache key.

To configure the behavior of the purge, such as to purge globally rather than within the POP, use purge_with_opts().

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

Example:

Parameters

key: std::span<const std::uint8_t>

Returns

tl::expected<void, CacheError>
std::vector<std::uint8_t> key_bytes = {0x01, 0x02, 0x03};
purge(key_bytes);

Overload 2 of 2

tl::expected<void, CacheError> fastly::cache::simple::purge(std::string_view key)
View source

Purge the entry associated with the given cache key.

To configure the behavior of the purge, such as to purge globally rather than within the POP, use purge_with_opts().

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

Example:

Parameters

key: std::string_view

Returns

tl::expected<void, CacheError>
purge("my_key");