Skip to content

Incorrect original image cache key when using thumbnail options #705

@hyouuu

Description

@hyouuu

Hello! We're using 11.3.1 (because our StreamChat depends on that version) and we're using the cache like this:

// setup
ImagePipeline.shared = ImagePipeline(configuration: .withDataCache)

// setting the cache to the corresponding url right after taking a photo
ImagePipeline.shared.cache.storeCachedData(imageData, for: ImageRequest(url: URL(string: remoteURL)!))

// Try to use cached data - sometimes this gives cache and if accessed later on sometimes not anymore
if let cached = ImagePipeline.shared.cache.cachedImage(for: ImageRequest(url: url)) {
// Here the cached image will be wrong - would be a previously cached image data of a different url
}

It seems the cache behavior is not deterministic and giving wrong data is pretty concerning - it feels there's some self correction actions to invalidate the cache somehow after accessing it - any insights?

Not sure if this is related to #700

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions