-
Notifications
You must be signed in to change notification settings - Fork 511
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
Allow providing a custom cache key which overrides the url in pin_setImage(from: URL?) #630
Comments
Can you override PINRemoteImage/Source/Classes/include/PINRemoteImageManager.h Lines 596 to 605 in 18637e4
|
Thank you for the reply, I think that should be enough to go on! I like the idea of setting the key at the same time as setting the URL because this override method requires additional state management/parsing of the URL (unless I'm missing a better way), but thank you for the suggestion. To use this properly I would subclass |
Yes, you'll need to override the class and then call PINRemoteImage/Source/Classes/include/PINRemoteImageManager.h Lines 219 to 225 in 18637e4
It's certainly not the most elegant solution and annoyingly has to be called before any parts of your code call the |
Really appreciate the quick responses, thank you! I think this is enough for me to go on, I do think something like what I mentioned in the issue would be pretty slick in the future but this should work! |
My server sends lots of signed URLs which means the PIN cache downloads new images every time since the signed URL is slightly different. I'd like to use a custom key that I pass in, and then the library would only use the URL for downloading the image, not for use as the cache key.
It could look like this:
Would this be possible? Is there any other way to get around handling lots of signed URLs without redownloading every time?
The text was updated successfully, but these errors were encountered: