Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
Technical Solution
Extend
ImagePipeline
to support caching processed images and allow users to configure the pipeline to store only the original image data, or only the processed image data, or both.The are multiple prerequisites for making this work.
#229 Decoupling Image Decompression ✅
Decompression is currently part of image processing which it shouldn't be because now in the case when we have processed image data, we will need to decompress it but we won't need to process it again.
#228 Generating Keys ✅
In Nuke 7
ImagePipeline
simply usesrequest.urlString
as a cache key which isn't enough for image processing. We need to be able to append image processors to these keys.#233 Encoding Images ✅
Nuke currently provides image decoding infrastrucure:
ImageDecoding
,ImageDecoder
,ImageDecoderRegistry
. But it would now also need to be able to encode processed images.#235 ImagePipeline v2 ✅
The first version of
ImagePipeline
introduced in Nuke 7 has some technical debt which needs to be addressed. The primary reason for adding tech debt was introduction of progressive decoding without rethinking the existing solution.Before #227 Caching Processing Image can be implemented this tech debt needs to be addressed.
Data Caching ✅
This one probably doesn't require any changes, we can use the existing
DataCaching
protocol for caching data:Usage
Enabling data cache for processed images:
If you only want to cache processed images set
isDataCachingForOriginalImageDataEnabled
tofalse
.Future Improvements
Allow user to change disk cache options per request: