System Configuration
config/system.yaml controls how the Dune engine behaves — caching, content parsing, image handling, and more.
Full reference
# Content settings
content:
dir: "content" # content directory (relative to site root)
markdown:
extra: true # extended markdown features
auto_links: true # auto-link URLs in text
auto_url_links: true # auto-link bare URLs
# Cache settings
cache:
enabled: true
driver: "filesystem" # "memory", "filesystem", or "kv"
lifetime: 3600 # seconds
check: "file" # "file" (mtime), "hash", or "none"
# Image processing
images:
default_quality: 80 # JPEG/WebP quality (1-100)
cache_dir: ".dune/cache/images"
allowed_sizes: [320, 640, 768, 1024, 1280, 1536, 1920] # prevent resize attacks
# Language support
languages:
supported: ["en"]
default: "en"
include_default_in_url: false # if true: /en/page, if false: /page
# Typography
typography:
orphan_protection: true # prevent single-word last lines in paragraphs
# Admin settings
admin:
max_upload_mb: 100 # max media upload size in MB (default: 100)
# Session persistence
session_store:
type: "local" # "local", "kv", or "redis"
# url: "$REDIS_URL" # required when type is "redis"
# Debug mode
debug: false
# Timezone
timezone: "UTC"
Cache drivers
| Driver | Storage | Best for |
|---|---|---|
filesystem |
.dune/cache/ directory |
Local development, traditional servers |
memory |
In-process memory | Development, small sites |
kv |
Deno KV store | Deno Deploy, edge deployment |
Cache invalidation
The check field determines how Dune detects stale content:
| Strategy | How it works | Trade-off |
|---|---|---|
file |
Compare file modification time | Fast, misses renames |
hash |
Hash file content | Accurate, slightly slower |
none |
Never invalidate | Fastest, manual rebuild needed |
Session store
session_store controls where admin and public-auth sessions are persisted. Defaults to local (file-backed, single-process) when omitted.
| Backend | Storage | Best for |
|---|---|---|
local |
File-backed, via the site's storage adapter | Single-process deployments, local development |
kv |
Deno KV | Deno Deploy or any multi-isolate environment (auto-selected there even if unset) |
redis |
Redis, via ioredis |
Traditional multi-process deployments behind a load balancer |
url is required when type is redis, and supports $ENV_VAR expansion:
session_store:
type: "redis"
url: "$REDIS_URL"
Admin sessions and public-auth sessions (see Public Auth) share this same backend selection but are kept in separate namespaces — a directory prefix for local/kv, a key prefix for redis — so the two never collide.
Environment-specific overrides
Development and production often need different settings. Put overrides in config/env/{name}/:
config/env/development/system.yaml:
debug: true
cache:
enabled: false
config/env/production/system.yaml:
debug: false
cache:
enabled: true
driver: "kv"
check: "hash"
Environment detection
Dune detects the current environment in this order:
DUNE_ENVenvironment variable (explicit)DENO_DEPLOYMENT_IDexists →"production"(Deno Deploy auto-detection)- Default:
"development"
Set DUNE_ENV in your deploy script:
DUNE_ENV=production dune serve
Typography
orphan_protection
Default: true
When enabled, Dune inserts a non-breaking space ( ) before the last word of every rendered paragraph. This prevents typographic orphans — single words stranded alone on the last line.
Disable if you're post-processing HTML output yourself or if your theme handles orphan prevention:
typography:
orphan_protection: false