← Back to Learn

Quick Tips

15 tips for getting the most out of bext in production.

Performance

1. Enable ISR for dynamic pages
Set revalidate intervals so bext serves cached HTML and regenerates in the background. Faster TTFB with fresh content.
2. Use streaming SSR with Suspense
Wrap slow data fetches in Suspense boundaries. The shell ships instantly and content streams in as it resolves.
3. Skip hydration for static pages
Pages without interactivity don't need client-side JS. bext detects this automatically and ships zero-JS HTML.
4. Leverage built-in compression
bext compresses responses with Brotli and gzip out of the box. No reverse proxy or middleware needed.

Security

5. Enable the WAF
Turn on the web application firewall for automatic protection against SQL injection, XSS, and common exploits.
6. Use HTTPS redirect
Enabled by default. All HTTP requests 301 to HTTPS. Certificates provision automatically via ACME.
7. Set Content-Security-Policy
Configure CSP in bext.config to lock down script sources. Prevents inline injection and third-party script abuse.
8. Rate-limit API endpoints
Use the rate-limit plugin or built-in middleware to cap requests per IP. Sliding window, Redis-backed.

Deployment

9. Zero-downtime deploys
bext swaps to the new build atomically. Old requests finish on the previous version, new requests hit the new one.
10. Health check endpoints
Define a health route so bext verifies the new version is healthy before completing the rollout.
11. Self-upgrade in production
Run bext upgrade to fetch the latest release and hot-swap the running instance without dropping connections. Use --check to preview first.

Toolchain

12. Use bext install instead of npm
bext's built-in package manager is written in Rust and significantly faster than npm. It reads your existing package-lock.json.
13. Download companions once
Run bext download ut ut/pack ut/web to fetch all toolchain binaries. They're placed next to the bext binary and work immediately.
14. Use bext x instead of npx
bext x runs package binaries from node_modules or fetches them on the fly. Same behavior as npx, no Node.js required.
15. Run scripts with bext ut run
bext ut run dev executes scripts from package.json. Supports workspaces with topological ordering via --workspaces.
Tutorials · Learning paths