Skip to content

Don't store image previews in the disk cache - #885

Merged
kean merged 1 commit into
mainfrom
fix/no-previews-in-disk-cache
Aug 15, 2026
Merged

kean merged 1 commit into
mainfrom
fix/no-previews-in-disk-cache

Conversation

@kean

@kean kean commented Aug 15, 2026

Copy link
Copy Markdown
Owner

ImagePipeline.Cache.storeCachedImage documented that previews are not stored, but the disk branch had no isPreview check. An app passing the latest progressive ImageContainer would write a half-decoded scan into the data cache under the final image key, and it would be served back as the completed image on the next load.

The disk branch now skips previews, matching the invariant TaskLoadImage.shouldStoreResponseInDataCache already enforces. Memory-cache behavior is unchanged (still governed by isStoringPreviewsInMemoryCache). Doc comment updated to describe the real contract, plus tests covering both layers.

storeCachedImage documented that previews are not stored, but the disk
branch had no isPreview check, so a progressive scan could be written
under the final image key. Match the pipeline invariant in
TaskLoadImage and skip previews on the disk path.
@kean
kean merged commit ae9e7e4 into main Aug 15, 2026
5 checks passed
@kean
kean deleted the fix/no-previews-in-disk-cache branch August 15, 2026 14:58
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.

1 participant