From 0cdabd3a8ff762c71684b64a9b71dc87309576e6 Mon Sep 17 00:00:00 2001 From: Pavel Matyukov Date: Thu, 1 Sep 2022 13:27:06 +0300 Subject: [PATCH] fix: image cache did not take into account request cache policy --- Libraries/Image/RCTImageLoader.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/Image/RCTImageLoader.mm b/Libraries/Image/RCTImageLoader.mm index 85a1fbae64c4e1..bf64f9c852a254 100644 --- a/Libraries/Image/RCTImageLoader.mm +++ b/Libraries/Image/RCTImageLoader.mm @@ -501,6 +501,10 @@ - (RCTImageURLLoaderRequest *)_loadImageOrDataWithURLRequest:(NSURLRequest *)req BOOL cacheResult = [loadHandler respondsToSelector:@selector(shouldCacheLoadedImages)] ? [loadHandler shouldCacheLoadedImages] : YES; + if (request.cachePolicy == NSURLRequestReloadIgnoringLocalCacheData) { + cacheResult = NO; + } + if (cacheResult && partialLoadHandler) { UIImage *image = [[self imageCache] imageForUrl:request.URL.absoluteString size:size