Reputation: 295
I remember that RN has cache for Image component. I just find out that RN 0.33 has no cache for Image on ios at all...... the testing code is very simple.
import React, { Component } from 'react';
import {
AppRegistry, Image
} from 'react-native';
class Project33 extends Component {
render() {
return (
<Image source={{uri: "http://172.25.235.14:8090/image/icon_points.png"}} style={{width: 50, height: 50}} />
);
}
}
AppRegistry.registerComponent('Project33', () => Project33);
On android, it works fine. it send only one HTTP GET request to get the image. After that, RN use cache to display the image no matter you restart the APP or reload in the APP.
On iOS, the APP sends one HTTP GET request everytime you reload or restart. Costs unnecessarily network flow, makes APP user waiting. it drives me cracy. My whole APP builds on the foundation that RN has cache for Image component......
I find out that on RN 0.31, Image component has cache on iOS.
Upvotes: 3
Views: 1282
Reputation: 1890
This is a bug that surfaced recently and is being fixed. Follow this issue.
Upvotes: 1