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

feat: image cacheKey #140

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jbrodriguez-bytelion
Copy link

Since we need this feature, I've rebased the original PR for upstream inclusion

Add an option to use a cache key that is different from the image
URI. This is useful for example if the image URI contains a parameter
that changes, but the image doesn't vary as a result, such as an
authentication token.

If the cache key is not present, the image URI will be used as the
cache key.
Create a single promise to handle the downloading of a cache
entry. Otherwise, multiple calls to get the path of a new cache
entry will result in multiple downloads, until one of the downloads
is successful.

If the download is unsuccesful, unset the promise so that the
next request will result in a new attempt to download the image.
@jbrodriguez-bytelion jbrodriguez-bytelion changed the title Feat/cache key feat: image cacheKey Dec 27, 2019
@nachozullo
Copy link

Hey @wcandillon! There is any chance of getting this merged soon? I need a key because my image uri is not static :(

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

Successfully merging this pull request may close these issues.

3 participants