Live Reload
Experience instant feedback. Soli's development server automatically detects changes and updates your browser without a restart.
Zero Configuration
Use the --dev flag to enable live reload. No browser extensions or complex build tools required.
How It Works
When you run the development server, Soli watches your project files. When a change is detected:
1. File Changed
You save a controller, view, or model file.
2. Recompile
Soli instantly re-parses and reloads the changed files in memory.
3. Refresh
The server notifies your browser via WebSocket to refresh the page.
Starting the Server
Use the CLI to start your app in development mode:
# Run with hot reload
soli serve . --dev
# Specify port
soli serve . --dev --port 8080
Styling with Tailwind
Soli handles asset compilation automatically. When you start the server with soli serve --dev, it will automatically compile your assets, including Tailwind CSS, without needing any complex build steps.
# Just run the server with --dev!
soli serve . --dev
Production Note
Live reload is disabled automatically when you build for release (`cargo build --release`). Your production app will be optimized for performance, not developer experience.
Production Mode
When you start the server without --dev, behaviour flips for static assets:
- Live reload is disabled. No WebSocket, no file watcher, no auto-refresh.
- CSS and JS files are snapshotted into memory at startup. The server walks
public/once and serves the bytes it loaded, with content-hashETagandCache-Control: public, max-age=31536000, immutable.
The in-memory snapshot exists to prevent a deploy-time race. If you overwrite public/css/app.css on disk before restarting the binary, the running process keeps serving the old bytes. Browsers that already loaded HTML referencing a specific asset version don't suddenly fetch mismatched new bytes against the cached page. The next binary restart reloads from disk.
Cached 12 CSS/JS assets (438213 bytes) for prod-mode serving
You'll see a line like the above on prod startup confirming the snapshot. Files larger than 10 MB are skipped (and read from disk on demand). Other extensions (images, fonts) continue to be read fresh from disk per request — only .css and .js are cached.