Disk icon indicating copy to clipboard operation
Disk copied to clipboard

Library/Caches counting towards app Documents & Data storage

Open AndrewSB opened this issue 1 year ago • 0 comments

Hey! posting this since I can't find any relevant documentation about this from Apple or otherwise:

It seems like iOS is counting my app's Library/Caches. all the documentation I can find (like https://developer.apple.com/documentation/foundation/optimizing_your_app_s_data_for_icloud_backup/#3928528) seems to explicitly call out the Caches/ usage isn't counted towards Documents & Data.

here's the app's usage, from the Settings app

image

If I download the app container, I see:

  1. the overall AppData folder is 613.8MB
  2. AppData/Library/Caches is 555.9MB
  3. the remaining files in AppData are 613.8-555.9=57.9MB

I'm confused as to why iOS seems to be counting my 0.5GB of caches towards my app's Documents & Data usage. for the files I'm saving in the cache, I use the static func url(for path: String?, in directory: Directory) throws -> URL, with the directory: .caches to access a sub folder inside the caches

Is this expected behavior? or am I doing something wrong? I expected the Settings app to report ~57MB of documents & data usage, not ~600MB

AndrewSB avatar Nov 01 '24 17:11 AndrewSB