Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageCache.get().clear() is not working on CustomCachedImage #89

Closed
pavinthan opened this issue Dec 18, 2017 · 3 comments
Closed

ImageCache.get().clear() is not working on CustomCachedImage #89

pavinthan opened this issue Dec 18, 2017 · 3 comments

Comments

@pavinthan
Copy link

CustomCachedImage always show first user image
Image url like {DOMAIN_NAME}/api/profile/images/cropped

<CustomCachedImage
     component={Thumbnail}
     large
     source={{
     uri: profileImage(),
     headers: {
        Authorization: oauth.token_type + ' ' + oauth.access_token
     },
}}/>
ImageCache.get().clear().done(() => {
    // some code
});
@aalkhulaifi605
Copy link

I am having the same issue where if the user updated his image on the backend , the app won't load the new image and will always load from cache . Setting it to mutable will fix this issue but the image will not be displayed when the user is offline and the app will always request the image .

Does the lib auto delete cache after their max-age is expiated ? My backend does return cache control with max-age but not sure if the lib will auto delete .

@mayur-padshala
Copy link

To your image URI, try adding the user id in query parameter.
Example: uri: `${profileImage()}?userId=${user_id}`,

This will make the URLs unique to each user and would help resolve your issue.

@pavinthan
Copy link
Author

@Nitroman605 @mayur-novus thanks for your advice, I used /api/profile/images/cropped?uuid={UUID} to fix the issue.

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants