Search code examples
iosswiftcachingtwittersdwebimage

iOS Twitter image caching strategy


The more I scroll through twitter, the more space is used on my iPhone disk storage. So I guess they use something like SDWebImage and store the images on the disk storage. My question is now when and how do they stop and clear it? I am looking to implement the same strategy for my project.


Solution

  • You can clear your cache or disk storage once in every 30 days. You should be having a logic that should save the timestamp when it deletes the cache and always check for the timestamp when you launch your app and clear the disk.