From 3a98318c91283a1bba35c0bca93b975d4a550330 Mon Sep 17 00:00:00 2001 From: Albert Sun Date: Mon, 5 Nov 2018 05:38:22 -0800 Subject: [PATCH] Increase cache and file size limits Summary: This change expands the limits to support a greater variety of scenarios. Reviewed By: PeteTheHeat Differential Revision: D12911841 fbshipit-source-id: a7c8eb6fece49dfe47b3ada98f55a02b43396ce8 --- Libraries/Image/RCTImageCache.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Image/RCTImageCache.m b/Libraries/Image/RCTImageCache.m index cf2be6cb3450b9..67848f9c4c8c6c 100644 --- a/Libraries/Image/RCTImageCache.m +++ b/Libraries/Image/RCTImageCache.m @@ -18,7 +18,7 @@ #import "RCTImageUtils.h" -static const NSUInteger RCTMaxCachableDecodedImageSizeInBytes = 1048576; // 1MB +static const NSUInteger RCTMaxCachableDecodedImageSizeInBytes = 2097152; // 2 MB static NSString *RCTCacheKeyForImage(NSString *imageTag, CGSize size, CGFloat scale, RCTResizeMode resizeMode) @@ -39,7 +39,7 @@ @implementation RCTImageCache - (instancetype)init { _decodedImageCache = [NSCache new]; - _decodedImageCache.totalCostLimit = 5 * 1024 * 1024; // 5MB + _decodedImageCache.totalCostLimit = 20 * 1024 * 1024; // 20 MB _cacheStaleTimes = [[NSMutableDictionary alloc] init]; [[NSNotificationCenter defaultCenter] addObserver:self