· 2 min read

Live vs Static Mode: Which One Should You Use?

architecture laravel best-practices

LangSyncer supports two modes for delivering translations to your Laravel app. Understanding the difference helps you pick the right one.

Static Mode

Translations are stored as files in your application.

CLI_TRANSLATOR_CLIENT_MODE=static

How it works:

  1. Run php artisan translator:sync
  2. Translations download to storage/translator-client/
  3. Your app reads from local files
  4. Changes require re-running sync

Best for:

  • Traditional hosting (shared hosting, VPS)
  • Apps where you control deployments
  • Maximum reliability (no external dependencies at runtime)

Drawback:

  • Updates require running a command or webhook

Live Mode

Translations are cached and updated automatically via webhooks.

CLI_TRANSLATOR_CLIENT_MODE=live
CLI_TRANSLATOR_CLIENT_WEBHOOK_ENABLED=true

How it works:

  1. Translations cached in your Laravel cache (Redis, database, etc.)
  2. When you publish, LangSyncer sends a webhook
  3. Cache invalidates automatically
  4. Next request fetches fresh translations

Best for:

  • Serverless (Laravel Vapor, AWS Lambda)
  • Teams needing instant updates
  • Content teams who manage their own translations

Drawback:

  • Requires persistent cache driver (not file on serverless)

Auto Mode

Let LangSyncer decide.

CLI_TRANSLATOR_CLIENT_MODE=auto

It detects your environment:

  • Serverless? → Live mode
  • Traditional? → Static mode

My Recommendation

Start with Live mode. The instant updates are worth it. You can always switch to Static if you need more control.

For production apps with high traffic, consider:

  • Live mode with Redis cache
  • Fallback to static files if cache fails
  • translator:warmup on deploy to pre-populate cache

Try both modes →