cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sethi, Raman" <ra.se...@sap.com>
Subject NSURLCache from disk behavior
Date Thu, 19 Sep 2013 22:46:59 GMT
We have an enterprise app, a part of which is online and we are seeing that NSURLCache works
fine when the cache bits are served from the memory.

Now if the app exited and is restarted (as opposed to resumed) NSURLCache is not serving the
pages from the disk (as memory cache is wiped)

The disk part of the cache below seems to be populated as the sqlite DB is not empty and is
growing in size as the online part of the application is browsed
but returns nil when asked for the cached copy of the document.

Has anybody run into this ?

int cacheSizeMemory = 8 * 1024 * 1024; // 8MB
int cacheSizeDisk = 32 * 1024 * 1024; // 32MB
NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk
diskPath:@"nsurlcache"];
[NSURLCache setSharedURLCache:sharedCache];

Thanks

Raman

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message