Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6527995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:29:36+00:00 2026-05-25T09:29:36+00:00

In my iPhone app I’m caching the raw data of some compressed files to

  • 0

In my iPhone app I’m caching the raw data of some compressed files to save loading time. But those files may change in an update.

Will iOS clear /Library/Caches for me when the app is updated or I need to clear it myself?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:29:37+00:00Added an answer on May 25, 2026 at 9:29 am

    Short:

    Will iOS clear /Library/Caches for me when the app is updated
    No

    Is it possible that iOS does clear everything or parts of Application_Home/Library/Caches during an update? Yes

    or I need to clear it myself? You need to ensure what you want to be cleared is cleared.

    Be prepared for both situations.

    How do you know whether your app got updated? See iOS Application Update Test

    Long:

    Files Saved During Application Updates When a user downloads an
    application update, iTunes installs the update in a new application
    directory. It then moves the user’s data files from the old
    installation over to the new application directory before deleting the
    old installation. Files in the following directories are guaranteed to
    be preserved during the update process:

    • Application_Home/Documents
    • Application_Home/Library

    Although files in other user directories may also be moved over, you
    should not rely on them being present after an update.

    From Apples Documentation: The Application Runtime Environment – Backup and Restore

    Application_Home/Library/Caches Use this directory to write any
    application-specific support files that you want to persist between
    launches of the application or during application updates. Your
    application is generally responsible for adding and removing these
    files. It should also be able to re-create these files as needed
    because iTunes removes them during a full restoration of the device.
    In iOS 2.2 and later, the contents of this directory are not backed up
    by iTunes.

    From Apples Documentation: The Application Runtime Environment – The File System (daveoncode)

    Here an example of when it does clear the cache during an “update”:
    You install app X V1.0. Lunch it once and the start doing something else. iOS malfunctions and needs to be restored. Developer releases V1.1. You update the app in iTunes on your Mac. You restore your device via iTunes. iTunes installs V1.1. User lunches your app. Your app does not get notified that any of that stuff happened but all files in Application_Home/Library/Cache are gone (iTunes removes them during a full restoration of the device).

    Really important information in there: It should also be able to re-create these files as needed. Like Kendall also pointed out it is a cache, so files could be deleted from it by the operating system at any point. So every time you load any file from Application_Home/Library/Caches you have to account for the case that the file isn’t there anymore (Kendall touched on this).

    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    if(![fileManager fileExistsAtPath:[cachePath stringByAppendingPathComponent:@"myfile.zip"]]) {
        //create it, copy it from app bundle, download it etc.
    }
    //start using it
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My iPhone app relies on a vendor's XML feed to provide data. But that
My iPhone app generates some very nice-looking plist files. I can look at them
In iPhone App, Can we take pictures at some perticular time intervals programmatically by
My iPhone app will be a free app but for some special content, users
On Iphone App start I start a background thread to receive some data from
My iphone app called Google Local Search(non javascript version) to behave some search business.
My iphone app downloads user specific data from our web server. How can I
My iPhone app will have read-only system data AND read/write user data (stored either
the iphone app I am writing shows white screen when first launched, but become
An iPhone app which I am creating generates reports from a Core Data database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.