React Native Cached Image Versions Save

CachedImage component for react-native

v1.4.3

6 years ago

v1.4.2

6 years ago

v1.4.1

6 years ago

v1.4.0

6 years ago

NOTE: v1.4.0 contains a lot of breaking changes - please read the readme

This is a major release that has a lot of breaking changes. All changes came from community requests, I took all the PRs and Issues discussions and compiled them into this new version. If anyone has anything to add/comment this is the place.

  • Move all cache logic to ImageCacheManager
  • Introduce ImageCacheProvider - a top-level component that provides an entry point for customization over the ImageCacheManager
  • Separate concerns of cache and storage.
    • MemoryCache manages the caching of URLs, this means that for each URL there is an entry in the cache with its expiration date, local file path, etc. - all decisions are made based on the url cache layer.
    • fs layer has no knowledge of the cache layer and is orchestrated by the ImageCacheManager
  • Use ES6 classes instead of the deprecated React.createClass
  • Use prop-types instead of the deprecated React.PropTypes

v1.3.5

6 years ago

v1.3.4

6 years ago

v1.3.3

6 years ago

Mainly fixes for Android:

  • Use custom renderImage when rendering the loader background image
  • Fix missing key warning on android
  • Fix mkdir errors on android
  • Set isCacheable to false when cacheImage failed
  • Properly fail when response status code is not 20*

v1.3.2

7 years ago
  • Added ImageCacheProvider.getCacheInfo() to retrieve info about the cache in the following format: (Thanks @gameboyVito @YouHan26)
{
  files: [], // an array of all files in the cache represented by their `fs.stat()` result
  size: 0    // size of cache in bytes (see example)
}
  • Added ImageCacheProvider.seedCache(local: string, url: string, options: CacheOptions): Promise to seed the cache for a given url with a local image. Useful to avoid having to download an image when you have a local copy. (Thanks @Froelund @hhravn)

v1.3.1

7 years ago

Possible breaking change

  • https://github.com/kfiroo/react-native-cached-image/pull/19 - All cached items are now under a single sub dir const SUB_DIR_PATH = 'subDirPath'; so we can implement a simple ImageCacheProvider.clearCache This will cause images that are already cached to be downloaded again to the new location.

NOTE: If you need an easy way to cleanup old images let me know please.

v1.3.0

7 years ago

* This is a minor release because current installations will break after upgrading.

As noted by @Froelund here react-native-fs is not maintained anymore, but its author points to react-native-fetch-blob as an alternative here

ImageCacheProvider now uses react-native-fetch-blob to download the images and save then locally.

NOTE: In order to upgrade you would need to install react-native-fetch-blob and uninstall react-native-fs unless you still need it see here :)