NSURLCache capacity에 대해서

Jongwon Woo
Sep 8, 2018 · 2 min read

[[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

Written by

I try to make something awesome.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade