---
title: simple
summary: The Compute Simple Cache API.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/
---

**Kind:** Module  
**Package:** fastly 0.13.1  
**Path:** `fastly::cache::simple`

The Compute Simple Cache API.

This is a non-durable key-value API backed by the same cache platform as the [Core Cache
API](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/core/).

### Cache scope and purging

Cache entries are scoped to Fastly [points of presence
(POPs)](https://developer.fastly.com/learning/concepts/pop/): the value set for a key in one POP
will not be visible in any other POP.

Purging is also scoped to a POP by default, but can be configured to purge globally with
Fastly's [purging feature](https://developer.fastly.com/learning/concepts/purging/).

### Interoperability

The Simple Cache API is implemented in terms of the [Core Cache API](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/core/). Items inserted with
the Core Cache API can be read by the Simple Cache API, and vice versa. However, some metadata
and advanced features like revalidation may be not be available via the Simple Cache API.

## Structs

| Name | Summary |
| --- | --- |
| [CacheEntry](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/struct.CacheEntry/) | The return type of the closure provided to [`get_or_set_with()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.get_or_set_with/). |
| [PurgeOptions](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/struct.PurgeOptions/) | Options for [`purge_with_opts()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.purge_with_opts/). |

## Enums

| Name | Summary |
| --- | --- |
| [CacheError](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/enum.CacheError/) | Errors arising from cache operations. |

## Functions

| Name | Summary |
| --- | --- |
| [get](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.get/) | Get the entry associated with the given cache key, if it exists. |
| [get_or_set](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.get_or_set/) | Get the entry associated with the given cache key if it exists, or insert and return the specified entry. |
| [get_or_set_with](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.get_or_set_with/) | Get the entry associated with the given cache key if it exists, or insert and return an entry specified by running the given closure. |
| [purge](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.purge/) | Purge the entry associated with the given cache key. |
| [purge_with_opts](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/fn.purge_with_opts/) | Purge the entry associated with the given cache key. |
