mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Lorenzo Sciandra
parent
ce09d6e571
commit
68dee8aee5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user