Files
homepage/.env.example
Alexander Bocken 1628f8ba23
All checks were successful
CI / update (push) Successful in 13s
feat: add Redis caching for recipe queries with automatic invalidation
Implements Redis caching layer for recipe endpoints to reduce MongoDB load and improve response times:

- Install ioredis for Redis client with TypeScript support
- Create cache.ts with namespaced keys (homepage: prefix) to avoid conflicts with other Redis applications
- Add caching to recipe query endpoints (all_brief, by tag, in_season) with 1-hour TTL
- Implement automatic cache invalidation on recipe create/edit/delete operations
- Cache recipes before randomization to maximize cache reuse while maintaining random order per request
- Add graceful fallback to MongoDB if Redis is unavailable
- Update .env.example with Redis configuration (REDIS_HOST, REDIS_PORT)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 20:25:11 +01:00

36 lines
1.2 KiB
Plaintext

# Database Configuration
MONGO_URL="mongodb://user:password@host:port/database?authSource=admin"
# Redis Cache Configuration (optional - falls back to direct DB queries if unavailable)
REDIS_HOST="localhost" # Redis server hostname
REDIS_PORT="6379" # Redis server port
# Authentication Secrets (runtime only - not embedded in build)
AUTHENTIK_ID="your-authentik-client-id"
AUTHENTIK_SECRET="your-authentik-client-secret"
# Static Configuration (embedded in build - OK to be public)
AUTHENTIK_ISSUER="https://sso.example.com/application/o/your-app/"
# File Storage
IMAGE_DIR="/path/to/static/files"
# Optional: Development Settings
# DEV_DISABLE_AUTH="true"
# ORIGIN="http://127.0.0.1:3000"
# Optional: Additional Configuration
# BEARER_TOKEN="your-bearer-token"
# COOKIE_SECRET="your-cookie-secret"
# PEPPER="your-pepper-value"
# ALLOW_REGISTRATION="1"
# AUTH_SECRET="your-auth-secret"
# USDA_API_KEY="your-usda-api-key"
# Translation Service (DeepL API)
DEEPL_API_KEY="your-deepl-api-key"
DEEPL_API_URL="https://api-free.deepl.com/v2/translate" # Use https://api.deepl.com/v2/translate for Pro
# AI Vision Service (Ollama for Alt Text Generation)
OLLAMA_URL="http://localhost:11434" # Local Ollama server URL