NSURLCache capacity에 대해서

Jongwon Woo
2 min readSep 8, 2018

--

[[NSURLCache sharedURLCache] setDiskCapacity:0];

[[NSURLCache sharedURLCache] setMemoryCapacity:0];

URLSession task 호출을 반복해도 아래와 같이 유지된다.

NSURLCache currentDiskUsage:86016

NSURLCache currentMemoryUsage:0

// [[NSURLCache sharedURLCache] setDiskCapacity:0];

// [[NSURLCache sharedURLCache] setMemoryCapacity:0];

URLSession task 호출을 반복하면 diskUsage는 계속 증가하지만, memoryUsage는 3387까지 증가 후 멈췄다.

NSURLCache currentDiskUsage:1133885

NSURLCache currentMemoryUsage:3387

그런데 URLSession task와 달리 웹뷰에서 웹페이지를 아무리 열어도 URLCache의 disk/memory usage는 늘어나지 않았다.

--

--

Jongwon Woo
Jongwon Woo

Written by Jongwon Woo

I try to make something awesome.

No responses yet