artifacts / AFCache

AFCache is an HTTP cache for iOS and OSX seeking towards full RFC2616 compliance
Apache License 2.0
361 stars 43 forks source link

No public method to force archive of cache data #18

Open allanweir opened 10 years ago

allanweir commented 10 years ago

I've been working on a project which performs a background fetch of large amounts of data. I'm using the ARC branch of AFCache but it seems like if the app is terminated after the fetch and before the app ever enters the foreground, then the cache store is not updated.

Is there a method in the library to force a save of the cache data?

artifacts commented 10 years ago

I've added the public method archiveNow. That should do it, but I didn't test it yet ...

allanweir commented 10 years ago

Thanks for getting back to me so quick! It doesn't look like this is working still during a background fetch - I think it's because a new thread is started which doesn't have time to complete. Calling archiveWithInfoStore instead of startArchiveThread seems to fix it.