Can you explain what you want?
I can't speak for what @gaojuanjuan may be requesting here but I have the need (I think) for what may be the same thing.
I'm requesting a list of image urls from an API that signs the image URL with a signature and expiration time parameter in the URL. Each time I call the API the signature and expiration time is different even though the image itself hasn't changed. Because the image URL changes each time, cached_network_image is unable to effectively cache this image.
If it was possible to provide a "cacheKey" in addition to the "imageUrl" and have cached_network_image use that key if provided for looking up the image from the cache.
I can't speak for what @gaojuanjuan may be requesting here but I have the need (I think) for what may be the same thing.
I'm requesting a list of image urls from an API that signs the image URL with a signature and expiration time parameter in the URL. Each time I call the API the signature and expiration time is different even though the image itself hasn't changed. Because the image URL changes each time, cached_network_image is unable to effectively cache this image.
If it was possible to provide a "cacheKey" in addition to the "imageUrl" and have cached_network_image use that key if provided for looking up the image from the cache.
I have exactly same problem. It would be nice to have some kind of optional storage id for the image
@renefloor if there's interest in this then it's something I can look at implementing - We have this requirement also.
A typical example is using presigned URLs to download a file from S3. The URL includes the authentication parameters, which will eventually expire. The file itself will never change, but the URL to download it does, limiting the ability to cache the file with this library.
I think @daikini's suggestion of an optional cacheKey parameter, falling back to the existing approach of using the url would work for most use cases where a file might be identified by an ID, but a signed or otherwise authenticated request is made to download.
Just wanted to hear your thoughts / get the all clear before I go off and build something.
Looks like this will require modifications to flutter_cache_manager to support providing a cacheKey when downloading files, in addition to modifications to this library.
@MichaelMarner this is very useful feature
Most helpful comment
I can't speak for what @gaojuanjuan may be requesting here but I have the need (I think) for what may be the same thing.
I'm requesting a list of image urls from an API that signs the image URL with a signature and expiration time parameter in the URL. Each time I call the API the signature and expiration time is different even though the image itself hasn't changed. Because the image URL changes each time, cached_network_image is unable to effectively cache this image.
If it was possible to provide a "cacheKey" in addition to the "imageUrl" and have cached_network_image use that key if provided for looking up the image from the cache.