---
title: cache
summary: Compute Cache APIs.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/
---

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

Compute Cache APIs.

Compute exposes multiple interfaces to the platform's cache:

### Read-through HTTP caching

[`Request::send()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/#method-send) offers read-through caching for HTTP requests. The
HTTP response received from the backend will be cached and reused for subsequent requests if it
meets cacheability requirements. The behavior of this automatic caching can be tuned via methods
like [`Request::set_ttl()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/#method-set_ttl) and
[`Request::set_pass()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/#method-set_pass).

This interface provides the full benefits of Fastly's purging, request collapsing, and
revalidation capabilities, and is recommended for most users who need to cache HTTP responses.

### Simple Cache API

The [`simple`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/) module contains 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/), intended to be more accessible for use cases that do not require the
full flexibility of that API.

### Core Cache API

The [`core`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/core/) module exposes the Compute Core Cache API, the same set of primitive
operations used to build Fastly services. The Core Cache API puts the highest level of power in
the hands of the user, but requires manual serialization of cache contents and explicit handling
of request collapsing and revalidation control flow.

## Modules

| Name | Summary |
| --- | --- |
| [core](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/core/) | The Compute Core Cache API. |
| [simple](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/simple/) | The Compute Simple Cache API. |
