Messed up some stuff

This commit is contained in:
Hariharan Mudaliar 2025-10-11 14:20:23 +05:30
commit 56cb69d856
7 changed files with 85 additions and 30 deletions

View file

@ -19,9 +19,14 @@ public final class ImageService: ImageServiceProtocol {
private init() {
let config = URLSessionConfiguration.default
// Create proper cache directory path
let cacheDir = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first!
let artworkCachePath = cacheDir.appendingPathComponent("artwork_cache").path
let cache = URLCache(memoryCapacity: 50 * 1024 * 1024, // 50MB
diskCapacity: 100 * 1024 * 1024, // 100MB
diskPath: "artwork_cache")
diskPath: artworkCachePath)
config.urlCache = cache
config.timeoutIntervalForRequest = 15
config.timeoutIntervalForResource = 30