Project map for AI agents. Keep this file up-to-date as the project evolves.
wait0 is an ultra-fast cache-first HTTP reverse proxy written in Go that serves from cache instantly and revalidates responses in the background. It targets SSR and other dynamic origin workloads where latency and origin offload are critical.
- Language: Go 1.22
- Framework: Standard library
net/http - Database: LevelDB (embedded disk cache)
- ORM: N/A
.
├── cmd/
│ └── wait0/
│ └── main.go # Program entrypoint and HTTP server lifecycle
├── internal/
│ └── wait0/
│ ├── service_core.go # Service composition root and lifecycle wiring
│ ├── config.go # YAML schema parsing + validation
│ ├── cache_ram.go # Root cache facade (wraps cache module)
│ ├── cache_disk.go # Root cache facade (wraps cache module)
│ ├── *_runtime_adapter.go # Root adapters that inject Service deps into modules
│ ├── auth/ # Shared bearer authentication
│ ├── invalidation/ # /wait0/invalidate API + async workers
│ ├── statapi/ # /wait0 stats API endpoint + snapshot payloads
│ ├── dashboard/ # /wait0/dashboard HTML + stats/invalidation bridge handlers
│ ├── proxy/ # Request handling/origin fetch/response headers
│ ├── revalidation/ # Revalidate and warmup orchestration
│ ├── discovery/ # Sitemap discovery and URL normalization
│ ├── stats/ # Metrics collector, periodic stats loop, proc probes
│ └── cache/ # Cache internals (RAM + LevelDB + codec)
├── debug/
│ ├── debug-compose.yml # Local debug stack (origin + wait0)
│ └── wait0.yaml # Debug configuration example
├── docs/
│ ├── for-developers.md # Build, config, and operations guide
│ └── api-endpoints.md # Endpoint and response reference
├── scripts/
│ ├── coverage.sh # Coverage helper script
│ ├── publish.sh # Publishing helper script
│ └── stress.sh # Stress/load helper script
├── Dockerfile # Container image build definition
├── README.md # Usage, config, behavior, and developer notes
├── go.mod # Go module definition and dependencies
└── go.sum # Dependency checksums
| File | Purpose |
|---|---|
| cmd/wait0/main.go | Bootstraps config/service, starts HTTP server, handles graceful shutdown |
| internal/wait0/service_core.go | Root composition: constructs module controllers and adapters |
| internal/wait0/dashboard/controller.go | Dashboard HTTP controller (Basic Auth + bridge endpoints + HTML shell) |
| internal/wait0/proxy/controller.go | Main request handling path and cache hit/miss/bypass flow |
| internal/wait0/revalidation/controller.go | Async revalidation and warmup orchestration |
| internal/wait0/cache_ram.go / cache_disk.go | Root cache facades wrapping internal/wait0/cache |
| internal/wait0/config.go | YAML configuration loading and rule parsing |
| debug/debug-compose.yml | Spins up reproducible local debug environment |
| Dockerfile | Defines production image for running wait0 |
| Document | Path | Description |
|---|---|---|
| README | README.md | Project landing page and quick start |
| For Developers | docs/for-developers.md | Build, config, and operations guide |
| API Endpoints | docs/api-endpoints.md | Endpoint and response reference |
| Docker Hub notes | DOCKERHUB.md | Alias to README for Docker Hub presentation |
This project uses a Makefile for build automation.
Common commands:
make help— list all available targetsmake test— run unit testsmake test-race— run race-enabled testsmake coverage— run coverage gate forinternal/wait0make lint— run static checks (go vet)make build— build thewait0binarymake ci-check— run full local quality gatemake docker-build/make docker-run— build and run the container locally