You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a custom plugin.
I download SVG data from URL, then I generate png image from SVG.
I don't want to cache SVG data (URL cache), I would cache png image, I would use LRU disk cache only for that.
My question is:
How to implement custom DataLoader without native URL cache but with LRU disk cache?
Below is my current implementation. The issue: data is caching to memory only even if I have configured the LRU cache in my custom ImagePipeline.
...LazyImage(request:request){ state in
if let image = state.image {
image.resizable().scaledToFit().padding(10)}else if state.error !=nil{Color(.systemBackground).frame(minWidth:140, minHeight:100).overlay{Image(systemName:"exclamationmark.octagon").font(.body)}}else{Color(.systemBackground).frame(minWidth:140, minHeight:100).overlay(ProgressView())}}.pipeline(customPipeline)...
The text was updated successfully, but these errors were encountered:
I would suggest trying DataCachePolicy.storeEncodedImages. It will encode the processed images (.png) and stored them in the disk cache (aka LRU cache, DataCache). It seems like exactly what you are looking for.
I'm trying to implement a custom plugin.
I download SVG data from URL, then I generate png image from SVG.
I don't want to cache SVG data (URL cache), I would cache png image, I would use LRU disk cache only for that.
My question is:
How to implement custom DataLoader without native URL cache but with LRU disk cache?
Below is my current implementation. The issue: data is caching to memory only even if I have configured the LRU cache in my custom ImagePipeline.
The text was updated successfully, but these errors were encountered: