twitter / ios-twitter-image-pipeline

Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients
Apache License 2.0
1.85k stars 109 forks source link

Setting maxBytes = 0 does not work #41

Closed gitdump1 closed 5 years ago

gitdump1 commented 5 years ago

In our project, we don't want a disk cache so we set [TIPGlobalConfiguration sharedInstance].maxBytesForAllDiskCaches = 0. However, that doesn't seem to be working. I DM'd with @NSProgrammer and he confirmed there are some places where 0 == off and others where 0 == unlimited (ex: https://github.com/twitter/ios-twitter-image-pipeline/blob/8b3eff1b4c44f258d66f2041d350c7a1d5b616dd/TwitterImagePipeline/TIPGlobalConfiguration.m#L542).

NSProgrammer commented 5 years ago

This is a legit issue and I can repro. Will work on a fix.

In the meantime, the workaround is to set the max bytes to be 1 byte.

NSProgrammer commented 5 years ago

Resolved with merge #42