Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What triggers iOS 5.0 cache purge?

Tags:

ios

iphone

ios5

As of iOS 5.0 Apple began to purge or clean the Caches directory inside individual applications when it decided the device was using too much space. Can anyone point me to the location of documentation or anecdotal information regarding at which threshold this cache cleaning occurs (for instance 90%+ disk usage) and how often it is checked?

like image 394
BadPirate Avatar asked Jan 18 '12 22:01

BadPirate


2 Answers

From my my testing, it seems that the wipe happens to all not currently running applications when the space usage on the device EXCEEDS the reported amount of space available (seems iPhone lies about space available to prevent you from getting into reserved space). When you cross that line, a dialogue pops up:

iPhone too much space Dialogue

And when you hit done, it then wipes the space. This is the only situation that I was able to reliably reproduce to trigger the wipe (for testing / etc), and I did so by filling my device as much as I could with movies and music, and then downloading big files in DropBox.

like image 151
BadPirate Avatar answered Oct 17 '22 03:10

BadPirate


as far as i know there hasn't been any official information about when the purge happens and - to be honest - you shouldn't be trying to predict it. it IS a problem, though. thankfully, apple has realised this and as of iOS 5.0.1 you can set a "do not backup" flag:

http://developer.apple.com/library/ios/#qa/qa1719/_index.html

so you'll want to place those files in your app's Documents/ dir or your apps Library/Private Documents/ and set the "do not backup" attribute.

like image 2
Mike K Avatar answered Oct 17 '22 04:10

Mike K