Skip to content

Commit

Permalink
Increase cache and file size limits
Browse files Browse the repository at this point in the history
Summary: This change expands the limits to support a greater variety of scenarios.

Reviewed By: PeteTheHeat

Differential Revision: D12911841

fbshipit-source-id: a7c8eb6fece49dfe47b3ada98f55a02b43396ce8
  • Loading branch information
fatalsun authored and facebook-github-bot committed Nov 5, 2018
1 parent 54f7eb3 commit 3a98318
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/Image/RCTImageCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 3a98318

Please sign in to comment.