Merged siteye's patch for performing the clearing of the cache in a background task on iOS.