Image Caching in Swift
Limiting the Cache on Disk
1 | Cancelling Image Requests 10:19 |
---|---|
2 | Caching Images in Memory 09:44 |
3 | Caching Images on Disk 09:27 |
4 | Asynchronously Reading Data from Disk 10:41 |
5 | Limiting the Cache on Disk 12:41 |
6 | Image Caching with Kingfisher 10:48 |
Sponsor
Sponsors enable me to publish more free content. Take a moment to visit this week's sponsor to support the work I do.
Dream it. Build it. Grow it.
Get reliable and affordable cloud hosting with DigitalOcean! Our platform provides secure cloud infrastructure for developers. With simple pricing and flexible configurations, you can get up and running quickly. Plus, our 24/7 support ensures you're never alone.
Earlier in this series, you learned that a cache on disk has a number of benefits. It persists the cache across launches and it can be used to seed a cache in memory. Even though modern devices have plenty of disk space, we need to be mindful of the space the cache on disk takes up on the user's device. Applications like Twitter and Instagram fetch hundreds if not thousands of images. Even if those images are optimized and small in size, the cache on disk can grow quickly, taking up a non-trivial amount of space on the user's device. In this episode, we add the ability to limit the size of the cache on disk, similar to how the image service limits the size of the cache in memory.
Instant and Unlimited Access
to 500+ Cocoacasts Tutorials
$19 / month
Pay Once a Month
30 Day Money Back Guarantee
$8.25 / month (billed annually)
Pay Once a Year and Save $129
30 Day Money Back
Guarantee