Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuke Cache configurations not respecting the sizeLimit and sweep mechanism #824

Open
snarang5590 opened this issue Dec 9, 2024 · 1 comment

Comments

@snarang5590
Copy link

Hi,

I am using Nuke library to cache images and prefetching a bunch of them for later use. I have a sizeLimit set to 300 MB

let dataCacheName = "\(UIApplication.appIdentifier).nukeDataCache"
var configuration = ImagePipeline.Configuration.withDataCache(name: dataCacheName, sizeLimit: 300 * 1024 * 1024)
configuration.isUsingPrepareForDisplay = true
ImagePipeline.shared = ImagePipeline(configuration: configuration)
Screenshot 2024-12-09 at 2 31 07 PM

And as I read in the docs DataCache has a sweep mechanism where by default it should clean the Cache every 60 mins which I am not seeing at all. Wanted to check is there something that I am doing wrong or is this a known issue?

For right now I have to manually clean up the cache periodically by one of the following ways:

ImagePipeline.shared.configuration.dataCache?.removeAll()

or

let dataCacheName = "\(UIApplication.appIdentifier).nukeDataCache"
let dc = try? DataCache(name: dataCacheName)
dc?.sweep()
@snarang5590
Copy link
Author

@kean Any follow ups on this?

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

No branches or pull requests

1 participant