CacheConfig class

Configuration for the SDK's caching layer.

Controls TTLs, capacity limits, the default read policy, and offline queue retries.

Constructors

CacheConfig({int maxMessagesPerRoom = 500, int maxRooms = 100, Duration ttlMessages = const Duration(hours: 24), Duration ttlRooms = const Duration(hours: 12), Duration ttlUsers = const Duration(hours: 6), Duration ttlMembers = const Duration(hours: 12), CachePolicy defaultReadPolicy = CachePolicy.networkFirst, int offlineQueueMaxRetries = 5, int offlineQueueMaxAttachmentBytes = 10 * 1024 * 1024})
const

Properties

defaultReadPolicy CachePolicy
final
hashCode int
The hash code for this object.
no setterinherited
maxMessagesPerRoom int
final
maxRooms int
final
offlineQueueMaxAttachmentBytes int
Upper bound, in bytes, on a single attachment queued for offline retry (NomaChatClient.enqueueOfflineAttachment). An attachment upload that fails while over this size is NOT queued — queuing it would mean carrying its raw bytes through Hive on every persist of the offline queue, base64-encoded, indefinitely. Defaults to 10 MB, comfortably above a compressed photo/voice note but well under a raw video. The drop is reported via onOperationDropped (reason 'attachment_too_large') instead of failing silently.
final
offlineQueueMaxRetries int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
ttlMembers Duration
Freshness window for a room's cached member roster (members:$roomId). Matches ttlRooms by default: a roster changes at the pace of the room, not of the message stream, and every local mutation plus every user_joined / user_left / user_role_changed event invalidates the key outright.
final
ttlMessages Duration
final
ttlRooms Duration
final
ttlUsers Duration
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited