Skip to content

Add an option to specify a custom cache key when using sd_setImageWithStorageReference #362

@erezrokah

Description

@erezrokah

Environment:

  • Objective C
  • iOS version: 11
  • Firebase SDK version: 4.3.0
  • FirebaseUI version: 4.1.1
  • CocoaPods Version: 1.3.1

Describe the problem:
sd_setImageWithStorageReference uses the storage path as the cache key.
As a result when storing a new image to the same storage path, the new image won't be loaded (the cached image will be loaded).

Steps to reproduce:

  1. Store an image in Firebase storage at a specific path.
  2. Use sd_setImageWithStorageReference to load it as instructed by documentation.
  3. Store a new image in Firebase storage at the same path.
  4. Use sd_setImageWithStorageReference to load the image again.
  5. Notice that the image from step 2 is loaded.

Observed Results:

  • Wrong image is loaded when using sd_setImageWithStorageReference

Expected Results:

  • Correct image is loaded when using sd_setImageWithStorageReference

A common solution is to allow a custom cache key.
The glide library has a "Signature" concept:

http://sjudd.github.io/glide/javadocs/360/com/bumptech/glide/signature/MediaStoreSignature.html

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions