Skip to content

Instantly share code, notes, and snippets.

@AseemWangoo
Created December 20, 2022 06:19
Show Gist options
  • Save AseemWangoo/a9a829167157d543429058bb356cc788 to your computer and use it in GitHub Desktop.
Save AseemWangoo/a9a829167157d543429058bb356cc788 to your computer and use it in GitHub Desktop.
url cache
void main() {
const dylibPath = '/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation';
final lib = URLCacheLibrary(DynamicLibrary.open(dylibPath));
final urlCache = NSURLCache.getSharedURLCache(lib);
if (urlCache != null) {
print('currentDiskUsage: ${urlCache.currentDiskUsage}');
print('currentMemoryUsage: ${urlCache.currentMemoryUsage}');
print('diskCapacity: ${urlCache.diskCapacity}');
print('memoryCapacity: ${urlCache.memoryCapacity}');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment