@@ -100,6 +100,10 @@ export class ImagePipeline {
100100 private mIos : SDImageCache = SDImageCache . sharedImageCache ;
101101 constructor ( ) { }
102102
103+ getCacheKey ( uri : string , context ) {
104+ return SDWebImageManager . sharedManager . cacheKeyForURLContext ( NSURL . URLWithString ( uri ) , context ) ;
105+ }
106+
103107 isInDiskCache ( uri : string ) : boolean {
104108 return this . mIos . diskImageDataExistsWithKey ( getUri ( uri ) . absoluteString ) ;
105109 }
@@ -117,7 +121,10 @@ export class ImagePipeline {
117121 }
118122
119123 evictFromCache ( uri : string ) : void {
120- this . mIos . removeImageForKeyWithCompletion ( getUri ( uri ) . absoluteString , null ) ;
124+ const key = getUri ( uri ) . absoluteString ;
125+ this . mIos . removeImageFromDiskForKey ( key ) ;
126+ this . mIos . removeImageFromMemoryForKey ( key ) ;
127+ // this.mIos.removeImageForKeyWithCompletion(getUri(uri).absoluteString, null);
121128 }
122129
123130 clearCaches ( ) {
@@ -401,17 +408,18 @@ export class Img extends ImageBase {
401408 }
402409
403410 const uri = getUri ( src ) ;
404- if ( this . noCache ) {
405- const key = uri . absoluteString ;
406- const imagePipeLine = getImagePipeline ( ) ;
407- const isInCache = imagePipeLine . isInBitmapMemoryCache ( key ) ;
408- if ( isInCache ) {
409- imagePipeLine . evictFromCache ( key ) ;
410- }
411- }
412411 this . isLoading = true ;
413412 let options = SDWebImageOptions . ScaleDownLargeImages | SDWebImageOptions . AvoidAutoSetImage ;
414413
414+ if ( this . noCache ) {
415+ // const key = uri.absoluteString;
416+ // const imagePipeLine = getImagePipeline();
417+ // const isInCache = imagePipeLine.isInBitmapMemoryCache(key);
418+ // if (isInCache) {
419+ // imagePipeLine.evictFromCache(key);
420+ // }
421+ options = options | SDWebImageOptions . FromLoaderOnly ;
422+ }
415423 if ( this . alwaysFade === true ) {
416424 options |= SDWebImageOptions . ForceTransition ;
417425 }
0 commit comments