https://github.com/block/cachew
Cachew (pronounced cashew) is a super-fast application-level pass-through cache
https://github.com/block/cachew
Last synced: 3 months ago
JSON representation
Cachew (pronounced cashew) is a super-fast application-level pass-through cache
- Host: GitHub
- URL: https://github.com/block/cachew
- Owner: block
- License: apache-2.0
- Created: 2025-12-15T21:18:43.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-03-09T23:38:54.000Z (3 months ago)
- Last Synced: 2026-03-10T05:44:54.578Z (3 months ago)
- Language: Go
- Homepage:
- Size: 462 KB
- Stars: 15
- Watchers: 0
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
- Governance: GOVERNANCE.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Cachew (pronounced cashew) is a super-fast pass-through cache
Cachew is a server and tooling for incredibly efficient, protocol-aware caching. It is
designed to be used at scale, with minimal impact on upstream systems. By "protocol-aware", we mean that the proxy isn't
just a naive HTTP proxy, it is aware of the higher level protocol being proxied (Git, Docker, etc.) and can make more efficient decisions.
## Git
Git causes a number of problems for us, but the most obvious are:
1. Rate limiting by service providers.
2. `git clone` is very slow, even discounting network overhead
To solve this we apply two different strategies on the server:
1. Periodic full `.tar.zst` snapshots of the repository. These snapshots restore 4-5x faster than `git clone`.
2. Passthrough caching of the packs returned by `POST /repo.git/git-upload-pack` to support incremental pulls.
On the client we redirect git to the proxy:
```ini
[url "https://cachew.local/github/"]
insteadOf = https://github.com/
```
As Git itself isn't aware of the snapshots, Git-specific code in the Cachew CLI can be used to reconstruct a repository.
## Docker
## Hermit
Caches Hermit package downloads from all sources (golang.org, npm, GitHub releases, etc.).
**URL pattern:** `/hermit/{host}/{path...}`
Example: `GET /hermit/golang.org/dl/go1.21.0.tar.gz`
GitHub releases are automatically redirected to the `github-releases` strategy.