A Rust-based HTTP reverse-proxy cache intended as a replacement for the Shopware Varnish setup.
From: shopware/varnish-shopware default.vcl
- Reverse proxy cache in front of Shopware
- Cache key normalization
- Strip common tracking query params, then sort query
- Vary by
sw-cache-hashcookie (sw-cache-hashheader override supported) - Fallback vary by
sw-currencycookie
- Bypass cache for
Authorizationrequests- Non-GET/HEAD
- Paths:
/checkout,/account,/admin,/api(and subpaths)
- Special case
GET /widgets/checkout/info=> 204 whensw-cache-hashmissing or cart state not filled (see VCL)
- PURGE support with allowlisted purger IPs
PURGEwithxkeyheader: purge by tag(s) (Shopware-style)PURGEwithoutxkey: purge by URL
- BAN support with allowlisted purger IPs
- Response handling
- Grace/stale serving (3 days) after TTL expiration (Varnish grace analog)
- Strip
Set-Cookieon cacheable responses - Force client no-store for non-asset responses (assets +
store-apiare allowed)
- Full ESI implementation (we’ll design for it, but may ship later)
This repo includes a Dockerfile so you can build without having Rust installed locally.
docker build -t codycache .
docker run --rm -p 8080:8080 \
-e CODYCACHE_ORIGIN=http://127.0.0.1:8000 \
-e CODYCACHE_PURGERS=127.0.0.1/32,::1/128 \
-e CODYCACHE_CACHE_DIR=/var/lib/codycache \
-v $PWD/.codycache:/var/lib/codycache \
codycacheCODYCACHE_LISTEN(default0.0.0.0:8080)CODYCACHE_ORIGIN(required) e.g.http://shopware:8000CODYCACHE_PURGERScomma-separated CIDRs/IPs allowed to PURGE/BANCODYCACHE_CACHE_DIRdirectory for the disk cache (default./cache)
MIT