---
title: Purge
summary: Purge removes the entry associated with the given cache key, if one exists.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/cache/simple/fn.Purge/
---

**Kind:** Function  
**Module:** [simple](https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/cache/simple/)  
**Package:** compute-sdk-go v1.11.0  
**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/cache/simple/simple.go#L150

```go
func Purge(key []byte, opts PurgeOptions) error
```

Purge removes the entry associated with the given cache key, if one
exists.

The scope of the purge can be controlled with the PurgeOptions.

Purges are handled asynchronously, and the cached object may persist
in cache for a short time (~150ms or less) after this function
returns.

**Parameters**

- `key`: `[]byte`
- `opts`: `PurgeOptions`

**Returns**

`error`
