API Cache ProxyAPI Cache Proxy
Open source ยท Docker ready ยท Built with Go

Cache your APIs. Reduce latency. Scale with confidence.

A lightweight API caching gateway built with Go, Redis and Docker.

โšก

Multi-level caching

L1 in-memory cache for speed and L2 Redis cache for persistence and shared access.

๐ŸŽฏ

Cache policies

Control caching behavior per endpoint with public, private and bypass policies.

๐Ÿ“Š

Observability

Prometheus metrics provide visibility into requests, cache hits and backend traffic.

๐Ÿณ

Docker ready

Run the complete gateway stack using Docker Compose.

๐Ÿ”

TLS & authentication

Traefik provides TLS termination and protects administrative endpoints.

๐Ÿ› ๏ธ

Easy to configure

Configure cache behavior, TTLs and policies without changing the core application.

Architecture

See how it works

API Cache Proxy sits between your applications and backend APIs, combining in-memory caching, Redis and configurable cache policies to serve responses faster and reduce backend traffic.

View architectureโ†’
Request flow
Client
HTTP Request
โ†“
Traefik
TLS ยท Authentication
โ†“
API Cache Proxy
Go ยท Cache Policy
cache layers
L1
Memory
L2
Redis
โ†“
Backend API
Upstream

Performance

Faster responses with caching

The first request reaches the backend. Once the response is cached, subsequent requests can be served directly from memory.

First request

Cache MISS
Client
  โ”‚
  โ–ผ
L1 โ”€โ”€ MISS โ”€โ”€โ–บ L2 โ”€โ”€ MISS โ”€โ”€โ–บ Backend
                                  โ”‚
                                  โ–ผ
                              ~300 ms

The request travels through the cache layers and eventually reaches the backend API.

Next request

Cache HIT
Client
  โ”‚
  โ–ผ
L1 โ”€โ”€ HIT โ”€โ”€โ–บ Response
                โ”‚
                โ–ผ
               ~2 ms

The cached response is served directly from the L1 in-memory cache without contacting the backend.

Illustrative latency. Actual performance depends on the backend, network and cache configuration.

Interactive demo

Try it yourself

Test API caching with a real public API and see the difference between a cache miss and a cache hit.

Demo endpoint provided byhttps://httpbin.org/.

Get started in minutes

Run the gateway locally using Docker Compose.

Terminal
git clone https://github.com/apicachedev/apicache.git
cd api-cache-proxy

docker compose up -d
Test the proxy
curl http://localhost/https://httpbin.org/delay/1

Contact

Get in touch

Have a question, found a bug, or want to discuss a custom feature? We'd love to hear from you.

Built with

GoRedisPrometheusDockerTraefik