Skip to content
rusthacks.dev
Topic

Web

Axum, Actix and Tower in anger: routing, middleware, APIs, and WebAssembly when the code has to run in a browser.

Flat illustration for the post “Actix Web With SQLx and Connection Pools in One Repository”, composed around database.
WebGuide

Actix Web With SQLx and Connection Pools in One Repository

Wire Actix Web 4 to a SQLx 0.9 pool the right way: build the pool once outside the factory closure, share it as web::Data, map errors with ResponseError, and see the 8 versus 28 connection difference when it goes wrong.

16 min read
Flat illustration for the post “Request Limits and Slow Client Attacks in Rust Services”, composed around web.
Security

Request Limits and Slow Client Attacks in Rust Services

Slow clients and oversized requests exhaust connections and memory. Set header and body timeouts, body size limits, concurrency limits and keep-alive bounds at the proxy and in the Axum service with Tower layers.

5 min read
Flat illustration for the post “Stale While Revalidate Caching in Rust Services Explained”, composed around perf.
Performance

Stale While Revalidate Caching in Rust Services Explained

Serve the cached value immediately, even if slightly old, and refresh it in the background. Learn the idea, the HTTP Cache-Control directives and an in-process implementation with a freshness window and a grace window.

4 min read
Flat illustration for the post “Rust Error Connection Refused From Reqwest and Sockets”, composed around errors.
Tooling

Rust Error Connection Refused From Reqwest and Sockets

Connection refused means nothing was listening at that address and port. Check the bind address, localhost versus 127.0.0.1, containers and Docker networks, startup order and the wrong port, with commands for each.

4 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.