Client-Side Caching
These middleware implementations cache responses from external APIs that your application calls. This is different from server-side caching, which caches your own application's responses.
Use client-side caching when:
- Calling external APIs
- Reducing API rate limit consumption
- Improving offline support
- Reducing bandwidth usage
- Speeding up repeated API calls
For server-side caching (caching your own app's responses), see Server-Side Caching.
Available Client Implementations
The following client implementations are provided by this crate:
reqwest
The http-cache-reqwest crate provides a Middleware implementation for the reqwest HTTP client.
surf
The http-cache-surf crate provides a Middleware implementation for the surf HTTP client.
ureq
The http-cache-ureq crate provides a caching wrapper for the ureq HTTP client. Since ureq is a synchronous HTTP client, this wrapper uses the smol async runtime to integrate with the async http-cache system.
tower
The http-cache-tower crate provides Tower Layer and Service implementations for caching HTTP requests and responses. It supports both regular and streaming cache operations for memory-efficient handling of large responses.