How to autodelete history while no connect to server

Hi!
Could you please help me to discover -
is there any possibility to autoclean local datacash in IOS,
if RC server is off,
or, for example,phone is on airplane mode.