react-native-fast-image
react-native-fast-image copied to clipboard
Cache key ignore url params
Adds functionality to exclude url parameters from the cache key genator used by SDWebImage and Glide.
Preview published on npm as react-native-fast-image-with-url-params-ignore
Any news about merge this PR?
@lucianojsjr Waiting for maintainers to review... you can use the version I published on npm https://www.npmjs.com/package/react-native-fast-image-with-url-params-ignore
I can see the use case for this. I think we would need to find a way to make this not a global setting though. It could be a property on the image source
@DylanVann Initially, that's what I wanted to do, but I was limited by the way the IOS library was implemented... 😔
I'm open to suggestions if you have any ideas
There was another attempt in https://github.com/DylanVann/react-native-fast-image/pull/424. In that version there is prop to control it per image, but the implementation is not optimal and leaks memory.
Thanks @paulrostorp for putting this together, I've got this working in my project and it was the perfect solution for the presigned URL issue (https://github.com/DylanVann/react-native-fast-image/issues/602).
For anyone else coming across this, I just installed the package npm i react-native-fast-image-with-url-params-ignore
and then I did a project-wide search and replace (swap react-native-fast-image
for react-native-fast-image-with-url-params-ignore
) exlcluding the node_modules folder and package.json, rebuilt and it worked like a charm.
Thanks @paulrostorp for writing this PR! Is merging still blocked by the fact it's a global setting?
@Mookiies I think package maintainers are unresponsive unfortunately
just in case anyone needs this, I have created a patch for this. thanks @paulrostorp
<FastImage
shouldIgnoreUrlParams // to enabled/disable ignore URL params
/>