MiniProgramCachePolicy constructor

const MiniProgramCachePolicy({
  1. bool enabled = true,
  2. Duration memoryTtl = const Duration(hours: 2),
  3. Duration dataTtl = const Duration(days: 30),
  4. Duration imageTtl = const Duration(days: 14),
  5. Duration audioTtl = const Duration(hours: 6),
  6. Duration videoTtl = const Duration(hours: 6),
  7. Duration stateInactiveTtl = const Duration(days: 60),
  8. Duration sessionInactiveTtl = const Duration(days: 60),
  9. int maxBytes = 20 * 1024 * 1024,
  10. int maxDataBytes = 10 * 1024 * 1024,
  11. int maxImageBytes = 20 * 1024 * 1024,
  12. int maxAudioBytes = 20 * 1024 * 1024,
  13. int maxVideoBytes = 50 * 1024 * 1024,
  14. int maxSessionBytes = 512 * 1024,
  15. int maxStateBytes = 5 * 1024 * 1024,
  16. Set<MiniProgramCacheBucket> allowedMiniProgramCacheBuckets = _defaultMiniProgramCacheBuckets,
  17. bool clearMemoryOnExit = true,
  18. bool clearExpiredOnStartup = true,
  19. bool clearSessionOnLogout = true,
  20. bool clearStateOnInactiveExpiry = true,
  21. 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,
});