Skip to content

Source.cache doesn't exist + strange cache #274

Closed
@ishigamii

Description

@ishigamii

HI, I just read the documentation and install the lib in my app and it's working pretty nicely now.

To start I am using :

    "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-fast-image": "^5.0.3",

Though I am having a bug/crash when I try to use the cache property of the source like described in the documentation :

source.cache?: enum
FastImage.cache.immutable - (Default) - Only updates if url changes.
FastImage.cache.web - Use headers and follow normal caching procedures.
FastImage.cache.cacheOnly - Only show images from cache, do not make any network requests.

If I put that in my code or check the code the cache object in FastImage doesn't exist which result in a crash.

capture d ecran 2018-08-31 a 17 52 56

my code is :

        <FastImage
          style={{ height: 200, marginVertical: 8 }}
          source={{
            uri: myurl,
            priority: FastImage.priority.normal,
            cache: FastImage.cache.cacheOnly,
          }}
          resizeMode={FastImage.resizeMode.cover}
        />

Second point is more a question. I am having one first page where you can see a gif loaded with FastImage very fast and then I got to a second view and doing the same simple code the gif is taking very long to charge this time. I don't understand why it charged fast at first and on a second view with the same url so it should be charged from cache it just takes like 20 secondes even longer than loading it with default Image.

The code is :

        <FastImage
          style={{ height: 200, marginVertical: 8 }}
          source={{
            uri: myurl,
            priority: FastImage.priority.normal,
          }}
          resizeMode={FastImage.resizeMode.cover}
        />

Thanks a lot
Hope it will help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions