DylanVann / react-native-fast-image

🚩 FastImage, performant React Native image component.
MIT License
8.21k stars 1.51k forks source link

Fast image 8.3.4 does not cache on android emulator #769

Open emclab opened 3 years ago

emclab commented 3 years ago

Here is a code loading an image from cloud with React Native 0.62.3/RN Fast Image 8.3.4 on android emulator:

 import { Col, Row, Grid } from 'react-native-easy-grid';
 import FastImage from 'react-native-fast-image';

 return (  
    <TouchableOpacity onPress={() => {navigation.navigate("Item Detail", item={item} )}}>
        <Grid style={styles.grid}>
            <Col size={1} >
                <FastImage source={{uri:item.artimages[0].path}} style={styles.itemImage}/>  //<<==path is the cloud URL of the image. The display size of image is 40x40 and the size of image is less than 1MB.            
            </Col>
            <Col size={4}>
                <Row size={4}>
                    <Text style={styles.titleText}>
                        {item.name}
                    </Text>
                </Row>
                <Row size={4}>
                    <Text style={styles.titleText}>
                        {item.description}
                    </Text>
                </Row>
            </Col>
        </Grid>            
    </TouchableOpacity>
);

The path is embedded with expiration and signature for authentication of the cloud image storage. Here is an URL example:

  https://myImage.aliyuncs.com/fOqMlr3Hc_7.jpg?Expires=1613253127&OSSAccessKeyId=TMP.3KhSceqrVN...VnjHh9DMq1dBZC&Signature=oponRvpd...EzylDU%D

What I notice on Android emulator is that it take about 5 second to load the image each and every time. It seems that fast image is not caching. My understanding is that fast image caches by default. What causes Fast Image not caching the image here?

SecretKeeper commented 3 years ago

same here

emclab commented 3 years ago

Any solution to the problem above? FastImage is not caching for any of the images residing on aliyuncs.com.

dandre-hound commented 3 years ago

yeah, same thing - android images just aren't caching. I'm running a debug build on a phone so it's not specific to the emulator. I'm not quite sure how to query the cache on android. @DylanVann any thoughts here? I'm happy to do some digging and create a repro example but I don't know if I should just log what's in the cache, run the android profiler, etc.

emclab commented 3 years ago

Hi, seems like this issue is not getting any attention. Are there other image solutions that have proper caching?