Discussion Forums  >  Uncategorized

Replies: 1    Views: 240

cteselle
Apple Fan
Profile
Posts: 34
Reg: Jun 13, 2011
California
340
06/19/11 11:53 AM (14 years ago)

Limiting cache size? or setting an expire for the cache?

Is there a way to limit the amount of data that is stored in the cache? I'm referring to the gallery. I'd like to cap it to XX mb, or even be able to set an expire date if possible. Is there a way to do this? or does this happen automagically?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/20/11 01:32 AM (14 years ago)
Good question. You can turn off the image caching in the app but that will prevent all the images from caching, not just some of them. I do see the benefit in what you're talking about. Hmm...not sure the best way to do this. The app doesn't monitor how much space or how many files are being saved. When you click refresh on the home screen (or on the gallery if you use a dataURL and a refresh button), the cached files are removed - all of them. I can think of a few different ways to do this with code but it would take some skill (on your end) to try to implement it. Have a look at BT_Objects > BT_fileManager.m then the deleteAllLocalData method. This is the method that removes all the saved data. I guess you could modify this to measure the number of files before deleting them?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.