Skip to content

Caching

All backend SDKs cache flag values locally to minimize API calls and provide resilience when the API is unavailable. The cache is refreshed at intervals determined by the API response.

Most SDKs default to SQLite for persistent caching:

  • Survives application restarts
  • Stored at /tmp/flags.db by default (configurable)
  • Thread-safe with proper locking
  • Automatic cleanup of expired entries

Available in: Go, Python, PHP, C#, Kotlin

All SDKs support in-memory caching:

  • Faster read performance
  • Data lost on application restart
  • Lower overhead for short-lived processes

Available in: All SDKs

For distributed applications needing shared cache:

  • Shared across multiple instances
  • Supports password authentication
  • Configurable key prefix

Available in: PHP

The API response includes an intervalAllowed field that tells the SDK how frequently to refresh flags. SDKs respect this interval and re-fetch automatically in the background.

SDKDefaultOptions
GoSQLiteMemory
RustMemory
PythonSQLiteMemory
PHPSQLiteRedis
C#SQLiteMemory
SwiftMemory
KotlinSQLiteMemory
RubyMemory
ReactMemory (in-browser)
Next.jsMemory (in-browser)