---
title: purge
summary: Purge the entry associated with the given cache key.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.purge/
---

**Kind:** Function  
**Module:** [simple](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/)  
**Package:** fastly 0.13.1  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/cache/simple.rs#280

```rust
fn purge(key: impl Into<CacheKey>) -> Result<(), CacheError>
```

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()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.purge_with_opts/).

##### 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`](https://docs.rs/bytes/latest/bytes/bytes/struct.Bytes.html) to see which types can be used
as a key.

**Parameters**

- `key`: `impl Into<CacheKey>`

**Returns**

`Result<(), CacheError>`
