react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

Cache key ignore url params

Open paulrostorp opened this issue 2 years ago • 10 comments

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

paulrostorp avatar Sep 27 '22 13:09 paulrostorp

Any news about merge this PR?

lucianojsjr avatar Oct 11 '22 13:10 lucianojsjr

@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

paulrostorp avatar Oct 13 '22 06:10 paulrostorp

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 avatar Oct 31 '22 01:10 DylanVann

@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

paulrostorp avatar Nov 02 '22 07:11 paulrostorp

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.

tmm1 avatar Nov 10 '22 19:11 tmm1

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.

jakehasler avatar Dec 16 '22 16:12 jakehasler

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

Mookiies avatar Jun 29 '23 18:06 Mookiies

@Mookiies I think package maintainers are unresponsive unfortunately

TheRealNate avatar Jul 21 '23 04:07 TheRealNate

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

RZulfikri avatar Jul 10 '24 19:07 RZulfikri