Getting Started
This guide gets PRISM running in under five minutes.
Prerequisites
- Docker (recommended) or a Linux server with a Rust toolchain
- Google Chrome or Chromium installed and available in
$PATH(the Docker image bundles Chromium automatically)
Quick Start with Docker
docker run -d -p 4000:4000 -p 4001:4001 \
-e RUST_LOG=info \
ghcr.io/trident-cache/prism:1.0.0
Port 4000 serves proxied traffic. Port 4001 exposes the admin API.
By default PRISM expects your SPA origin at http://localhost:3000. Override it with a config file or environment variable (see Configuration).
Quick Start from Binary
Download the latest release from GitHub Releases, then run:
chmod +x prism
./prism --config config.toml
Minimal Configuration
Create a config.toml:
[server]
address = "127.0.0.1:4000"
origin = "http://my-app:3000"
mode = "bot-only" # or "render-all"
address-- the host and port PRISM listens on.origin-- the upstream SPA that PRISM will fetch pages from and render.mode--bot-onlyrenders only for detected bots (default).render-allrenders every request through headless Chrome.
Test It
Send a request with a regular browser User-Agent:
curl -s -o /dev/null -w "%{http_code}" http://localhost:4000/
# 200 -- proxied directly from origin, no rendering
Now send a request as Googlebot:
curl -s -H "User-Agent: Googlebot" http://localhost:4000/ | head -20
# Fully rendered HTML with all JS-generated content
The X-Prism-Cache response header tells you whether the result was a cache hit or miss.
Verify with the Admin API
Check that PRISM is healthy:
curl http://localhost:4001/health
# {"status":"ok"}
View Prometheus metrics:
curl http://localhost:4001/metrics
Next Steps
- Configuration -- full reference for
config.tomloptions - Rendering -- tune Chrome pool size, timeouts, and wait strategies
- Deployment -- production deployment patterns with Docker, systemd, and Kubernetes