Skip to content

Commit

Permalink
Add cache control check to multisource
Browse files Browse the repository at this point in the history
Differential Revision: D65337414
  • Loading branch information
Abbondanzo authored and facebook-github-bot committed Nov 1, 2024
1 parent af384a9 commit ae022d0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package com.facebook.react.views.imagehelper

import com.facebook.imagepipeline.core.ImagePipelineFactory
import com.facebook.react.modules.fresco.ImageCacheControl

/** Helper class for dealing with multisource images. */
public object MultiSourceHelper {
Expand Down Expand Up @@ -62,7 +63,10 @@ public object MultiSourceHelper {
best = source
}
if (precision < bestCachePrecision &&
source.cacheControl != ImageCacheControl.RELOAD &&
(imagePipeline.isInBitmapMemoryCache(source.uri) ||
// TODO: T206445115 isInDiskCacheSync is a blocking operation, we should move this to
// a separate thread
imagePipeline.isInDiskCacheSync(source.uri))) {
bestCachePrecision = precision
bestCached = source
Expand Down

0 comments on commit ae022d0

Please sign in to comment.