Gleam is a lightweight, configurable reverse proxy with built-in caching capabilities.
1.8K
Gleam is a lightweight, configurable reverse proxy with built-in caching capabilities.
Set the following environment variables to configure Gleam:
ORIGIN_URL: Backend server URL (default: https://httpbin.org)TTL_MINUTES: Cache entry time-to-live in minutes (default: 5)PORT: Port to run Gleam on (default: 8080)REDIS_URL: Redis URL (optional, default: redis://localhost:6379/0)CACHE_TYPE: Set to 'memory' or 'redis' (default: memory)go run gleam.goGleam will cache GET requests and serve cached responses when available, improving response times and reducing load on your origin server.
There is a Docker image maintained as jonbaldie/gleam.
Here's a sample usage, proxying requests to my personal site on port 80:
docker run --rm -p 80:80 -e ORIGIN_URL=https://www.jonbaldie.com -e PORT=80 jonbaldie/gleam
This is one of my favourite features of Gleam. By setting CACHE_TYPE=redis and REDIS_URL=redis://{username}:{password}@{hostname}:{port}/{database} Gleam will cache your HTTP requests in Redis.
This uses version 8 of go-redis so if you are having trouble setting your Redis URL, use their documentation here.
I like Varnish but the configuration for it is a nightmare, and much of the documentation is decades old. Gleam intends to take on much of the critical functionality with a much easier configuration experience.
Gleam is intended for an origin server that presents static contents, or static contents determined by the URL accessed. It is not recommend to use Gleam to cache the contents of, say, a logged-in dashboard where the data is dynamic or determined by sessions.
Content type
Image
Digest
sha256:d276727c9…
Size
106.2 MB
Last updated
about 21 hours ago
docker pull jonbaldie/gleam