|
|
|
|
36
|
* [Web API Polyfills](#user-content-web-api-polyfills)
|
36
|
* [Web API Polyfills](#user-content-web-api-polyfills)
|
37
|
* [Performance Tips](#user-content-performance-tips)
|
37
|
* [Performance Tips](#user-content-performance-tips)
|
38
|
* [API References](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API)
|
38
|
* [API References](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API)
|
|
|
39
|
+* [Caveats](#user-content-caveats)
|
39
|
* [Trouble Shooting](https://github.com/wkh237/react-native-fetch-blob/wiki/Trouble-Shooting)
|
40
|
* [Trouble Shooting](https://github.com/wkh237/react-native-fetch-blob/wiki/Trouble-Shooting)
|
40
|
* [Development](#user-content-development)
|
41
|
* [Development](#user-content-development)
|
41
|
|
42
|
|
|
|
|
|
737
|
|
738
|
|
738
|
## Performance Tips
|
739
|
## Performance Tips
|
739
|
|
740
|
|
740
|
-**Read Stream Event Overhead**
|
|
|
|
|
741
|
+**Read Stream and Progress Event Overhead**
|
741
|
|
742
|
|
742
|
When reading data via `fs.readStream` the process seems blocking JS thread when file is large, it's because the default buffer size is quite small (4kb) which result in large amount of events triggered in JS thread, try to increase the buffer size (for example 100kb = 102400) and set a larger interval (which is introduced in 0.9.4 default value is 10ms) to limit the frequency.
|
743
|
When reading data via `fs.readStream` the process seems blocking JS thread when file is large, it's because the default buffer size is quite small (4kb) which result in large amount of events triggered in JS thread, try to increase the buffer size (for example 100kb = 102400) and set a larger interval (which is introduced in 0.9.4 default value is 10ms) to limit the frequency.
|
743
|
|
744
|
|
|
|
|
|
759
|
|
760
|
|
760
|
<img src="img/performance_f2f.png" style="width : 100%"/>
|
761
|
<img src="img/performance_f2f.png" style="width : 100%"/>
|
761
|
|
762
|
|
|
|
763
|
+## Caveats
|
|
|
764
|
+
|
|
|
765
|
+* This library does not urlencode unicode characters in URL automatically, see [#146](https://github.com/wkh237/react-native-fetch-blob/issues/146).
|
|
|
766
|
+* When a `Blob` is created from existing file, the file **WILL BE REMOVE** if you `close` the blob.
|
|
|
767
|
+* If you replaced `window.XMLHttpRequest` for some reason (e.g. make Firebase SDK work), it will also effect how official `fetch` works (basically it should work just fine).
|
|
|
768
|
+* When file stream and upload/download progress event slow down your app, consider upgrade to `0.9.6+`, use [additional arguments](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API#fetchprogressconfig-eventlistenerpromisernfetchblobresponse) to limit its frequency.
|
|
|
769
|
+* When passing a file path to the library, remove `file://` prefix.
|
|
|
770
|
+
|
762
|
## Changes
|
771
|
## Changes
|
763
|
|
772
|
|
764
|
See [release notes](https://github.com/wkh237/react-native-fetch-blob/releases)
|
773
|
See [release notes](https://github.com/wkh237/react-native-fetch-blob/releases)
|