Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/cloudflare/pingora/llms.txt

Use this file to discover all available pages before exploring further.

Pingora is organised as a Cargo workspace where every piece of functionality lives in its own focused crate. The top-level pingora crate acts as an umbrella: it re-exports the most commonly needed items and uses Cargo features to pull in optional sub-crates such as pingora-proxy, pingora-load-balancing, and pingora-cache. This means you pay only for what you enable, and downstream crates that depend directly on a sub-crate (e.g. pingora-core) can do so without dragging in the full stack. The workspace uses Cargo resolver v2 and keeps shared dependency versions in [workspace.dependencies], so every crate agrees on the same versions of tokio, http, bytes, and friends.

Crate Reference Table

CratePurposeFeature flagNotes
pingoraUmbrella crate — re-exports everything under feature-gated modules (proxy, lb, cache, time)The recommended entry point for new projects
pingora-coreProtocols (HTTP/1, HTTP/2), server lifecycle, connectors, listeners, upstreamsPulled in by pingoraHome of Server, HttpPeer, BackgroundService
pingora-proxyProxyHttp trait, http_proxy_service(), session handlingproxyBuild reverse proxies by implementing ProxyHttp
pingora-cacheHTTP caching state machine, HttpCache, Storage trait, MemCachecacheExperimental — APIs are highly volatile
pingora-httpHTTP header types that preserve original header caseAlways availableWraps the http crate with case-preserving extensions
pingora-errorCommon Result / Error types used across all Pingora cratesAlways availableProvides OrErr, ErrorType, and Error::e_explain
pingora-load-balancingBackend selection algorithms, health checks, service discoverylbImplements BackgroundService for automatic updates
pingora-limitsEfficient counting and rate-limiting (Rate struct)Useful for per-IP or per-key rate limits
pingora-prometheusPrometheus metrics endpoint integrationAdd to Server as a listening service
pingora-memory-cacheAsync in-memory cache (RTCache) with cache-lock to prevent stampedeBacked by TinyUfo; general-purpose, not HTTP-specific
pingora-poolGeneric connection pool used internally by connectorsUsed by pingora-core connectors
pingora-timeoutEfficient async timer system with shared time wheeltimeMore efficient than tokio::time::timeout at scale
pingora-ketamaKetama consistent-hashing algorithmUsed by selection::Consistent in pingora-load-balancing
pingora-lruLRU cache data structure used by storage backendsInternal use; re-exported where needed
pingora-runtimeTokio runtime construction helpers and RuntimeOptsUsed internally; exposes RuntimeOpts for per-service tuning
pingora-opensslOpenSSL API compatibility layer (ssl, x509, pkey)opensslRequires native OpenSSL libs and Perl 5 at build time
pingora-boringsslBoringSSL API compatibility layer (identical API surface to pingora-openssl)boringsslRequires Clang; FIPS-compatible; used by Cloudflare internally
pingora-s2nAWS s2n-tls extensions: PSK, security policies, blinding delayss2nRequires native s2n-tls libraries
pingora-rustlsExperimental pure-Rust TLS via rustlsrustlsNot production-ready; do not use in critical paths
pingora-header-serdeSerialisation/deserialisation helpers for HTTP headersUsed by caching internals
tinyufoTinyUFO caching algorithm (the engine behind pingora-memory-cache)Standalone; can be used independently

Getting Started with Cargo

Add pingora to your Cargo.toml and select the features you need. Only one TLS provider feature can be active at a time.

Minimal HTTP proxy

[dependencies]
pingora = { version = "0.8.0", features = ["openssl", "proxy"] }
This pulls in pingora-core (with OpenSSL TLS), pingora-proxy, and pingora-http.

With load balancing

[dependencies]
pingora = { version = "0.8.0", features = ["openssl", "lb"] }
The lb feature implies proxy, so you get pingora-proxy and pingora-load-balancing together.

With caching

[dependencies]
pingora = { version = "0.8.0", features = ["openssl", "lb", "cache"] }
Adds the experimental pingora-cache layer on top of the load-balancing setup.

Using BoringSSL instead of OpenSSL

[dependencies]
pingora = { version = "0.8.0", features = ["boringssl", "lb"] }
Swap openssl for boringssl — the rest of the API is identical.

Feature Flags

FeatureEffect
opensslTLS via the openssl crate. Requires native OpenSSL and Perl 5.
boringsslTLS via BoringSSL. Requires Clang. FIPS-compatible.
s2nTLS via AWS s2n-tls. Enables PSK and advanced security policies.
rustlsExperimental pure-Rust TLS. Not production-ready.
proxyIncludes pingora-proxy and exports pingora_proxy::prelude::* under pingora::proxy.
lbIncludes pingora-load-balancing (and implies proxy). Exports under pingora::lb.
cacheIncludes pingora-cache (experimental). Exports under pingora::cache.
timeIncludes timeout and scheduling utilities from pingora-timeout.
sentryEnables Sentry error-reporting integration in pingora-core.
dial9Enables Tokio runtime telemetry (requires --cfg tokio_unstable).
dial9-worker-s3Adds S3-compatible trace-segment upload to dial9. Implies dial9.
dial9-cpu-profilingEnables CPU profiling support for dial9. Implies dial9.
connection_filterEnables pre-TLS TCP connection filtering via ConnectionFilter trait.
upstream_modulesEnables the adjust_upstream_modules callback for custom upstream response processing.
Only one TLS provider feature (openssl, boringssl, s2n, or rustls) can be selected at a time. Selecting more than one will cause a compile error.

Major Sub-Crates

Load Balancing

Backend selection with RoundRobin, Ketama consistent hashing, health checks, and dynamic service discovery via pingora-load-balancing.

Caching

HTTP-level caching state machine with pluggable storage backends via pingora-cache (experimental).

TLS

Choose from OpenSSL, BoringSSL, s2n-tls, or experimental rustls — all behind a uniform API.

Internals

Threading model, Tokio runtime configuration, service architecture, and connection lifecycle.

Build docs developers (and LLMs) love