MiniProgramCachePolicy constructor
const
MiniProgramCachePolicy({
- bool enabled = true,
- Duration memoryTtl = const Duration(hours: 2),
- Duration dataTtl = const Duration(days: 30),
- Duration imageTtl = const Duration(days: 14),
- Duration audioTtl = const Duration(hours: 6),
- Duration videoTtl = const Duration(hours: 6),
- Duration stateInactiveTtl = const Duration(days: 60),
- Duration sessionInactiveTtl = const Duration(days: 60),
- int maxBytes = 20 * 1024 * 1024,
- int maxDataBytes = 10 * 1024 * 1024,
- int maxImageBytes = 20 * 1024 * 1024,
- int maxAudioBytes = 20 * 1024 * 1024,
- int maxVideoBytes = 50 * 1024 * 1024,
- int maxSessionBytes = 512 * 1024,
- int maxStateBytes = 5 * 1024 * 1024,
- Set<
MiniProgramCacheBucket> allowedMiniProgramCacheBuckets = _defaultMiniProgramCacheBuckets, - bool clearMemoryOnExit = true,
- bool clearExpiredOnStartup = true,
- bool clearSessionOnLogout = true,
- bool clearStateOnInactiveExpiry = true,
- bool clearWhenOverLimit = true,
Implementation
const MiniProgramCachePolicy({
this.enabled = true,
this.memoryTtl = const Duration(hours: 2),
this.dataTtl = const Duration(days: 30),
this.imageTtl = const Duration(days: 14),
this.audioTtl = const Duration(hours: 6),
this.videoTtl = const Duration(hours: 6),
this.stateInactiveTtl = const Duration(days: 60),
this.sessionInactiveTtl = const Duration(days: 60),
this.maxBytes = 20 * 1024 * 1024,
this.maxDataBytes = 10 * 1024 * 1024,
this.maxImageBytes = 20 * 1024 * 1024,
this.maxAudioBytes = 20 * 1024 * 1024,
this.maxVideoBytes = 50 * 1024 * 1024,
this.maxSessionBytes = 512 * 1024,
this.maxStateBytes = 5 * 1024 * 1024,
this.allowedMiniProgramCacheBuckets = _defaultMiniProgramCacheBuckets,
this.clearMemoryOnExit = true,
this.clearExpiredOnStartup = true,
this.clearSessionOnLogout = true,
this.clearStateOnInactiveExpiry = true,
this.clearWhenOverLimit = true,
});