DylanVann / react-native-fast-image

🚩 FastImage, performant React Native image component.
MIT License
8.17k stars 1.5k forks source link

Cache key ignore url params #934

Open paulrostorp opened 2 years ago

paulrostorp commented 2 years ago

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

lucianojsjr commented 1 year ago

Any news about merge this PR?

paulrostorp commented 1 year ago

@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

DylanVann commented 1 year ago

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

paulrostorp commented 1 year ago

@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

tmm1 commented 1 year ago

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.

jakehasler commented 1 year ago

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.

Mookiies commented 1 year ago

Thanks @paulrostorp for writing this PR! Is merging still blocked by the fact it's a global setting?

TheRealNate commented 1 year ago

@Mookiies I think package maintainers are unresponsive unfortunately

RZulfikri commented 2 months ago

just in case anyone needs this, I have created a patch for this. thanks @paulrostorp

<FastImage
    shouldIgnoreUrlParams // to enabled/disable ignore URL params 
 />

react-native-fast-image+8.6.3.patch

julien9999 commented 1 day ago

just in case anyone needs this, I have created a patch for this. thanks @paulrostorp

<FastImage
    shouldIgnoreUrlParams // to enabled/disable ignore URL params 
 />

react-native-fast-image+8.6.3.patch

would you be able to regenerate it? doesn't seem to be working. Thanks