Skip to content

Instantly share code, notes, and snippets.

@serhatsezer
Created November 26, 2018 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save serhatsezer/5c2cd4f23e8c4e98f77bf85f6a58a0e9 to your computer and use it in GitHub Desktop.
Save serhatsezer/5c2cd4f23e8c4e98f77bf85f6a58a0e9 to your computer and use it in GitHub Desktop.
caching URL
let MEMORY_CAPACITY = 4 * 1024 * 1024
let DISK_CAPACITY = 20 * 1024 * 1024
let cache = URLCache(memoryCapacity: MEMORY_CAPACITY, diskCapacity: DISK_CAPACITY, diskPath: nil)
URLCache.shared = cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment