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โ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 MISSClient
โ
โผ
L1 โโ MISS โโโบ L2 โโ MISS โโโบ Backend
โ
โผ
~300 msThe request travels through the cache layers and eventually reaches the backend API.
Next request
Cache HITClient
โ
โผ
L1 โโ HIT โโโบ Response
โ
โผ
~2 msThe 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.
git clone https://github.com/apicachedev/apicache.git
cd api-cache-proxy
docker compose up -dcurl http://localhost/https://httpbin.org/delay/1Contact
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
