SDImageCacheConfig.m 867 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. #import "SDImageCacheConfig.h"
  9. static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
  10. @implementation SDImageCacheConfig
  11. - (instancetype)init {
  12. if (self = [super init]) {
  13. _shouldDecompressImages = YES;
  14. _shouldDisableiCloud = YES;
  15. _shouldCacheImagesInMemory = YES;
  16. _shouldUseWeakMemoryCache = YES;
  17. _diskCacheReadingOptions = 0;
  18. _diskCacheWritingOptions = NSDataWritingAtomic;
  19. _maxCacheAge = kDefaultCacheMaxCacheAge;
  20. _maxCacheSize = 0;
  21. _diskCacheExpireType = SDImageCacheConfigExpireTypeModificationDate;
  22. }
  23. return self;
  24. }
  25. @end