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
This commit is contained in:
Albert Sun
2018-11-09 14:01:35 +00:00
committed by Lorenzo Sciandra
parent ce09d6e571
commit 68dee8aee5
+2 -2
View File
@@ -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 @@ static NSString *RCTCacheKeyForImage(NSString *imageTag, CGSize size, CGFloat sc
- (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