From 126b0ae90a1033b01c7b59b058f1396368086a00 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 6 Feb 2022 14:36:01 -0500 Subject: [PATCH] Extend disk cache expiry times The cache keys are URLs, and Mastodon changes the url if the a new image is uploaded for avatar/header --- Tusker/Caching/ImageCache.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tusker/Caching/ImageCache.swift b/Tusker/Caching/ImageCache.swift index 248ae2fb..f34ea58f 100644 --- a/Tusker/Caching/ImageCache.swift +++ b/Tusker/Caching/ImageCache.swift @@ -10,10 +10,10 @@ import UIKit class ImageCache { - static let avatars = ImageCache(name: "Avatars", memoryExpiry: .seconds(60 * 60), diskExpiry: .seconds(60 * 60 * 24), desiredSize: CGSize(width: 50, height: 50)) - static let headers = ImageCache(name: "Headers", memoryExpiry: .seconds(60 * 5), diskExpiry: .seconds(60 * 60)) + static let avatars = ImageCache(name: "Avatars", memoryExpiry: .seconds(60 * 60), diskExpiry: .seconds(60 * 60 * 24 * 7), desiredSize: CGSize(width: 50, height: 50)) + static let headers = ImageCache(name: "Headers", memoryExpiry: .seconds(60 * 5), diskExpiry: .seconds(60 * 60 * 24 * 7)) static let attachments = ImageCache(name: "Attachments", memoryExpiry: .seconds(60 * 2)) - static let emojis = ImageCache(name: "Emojis", memoryExpiry: .seconds(60 * 5), diskExpiry: .seconds(60 * 60)) + static let emojis = ImageCache(name: "Emojis", memoryExpiry: .seconds(60 * 5), diskExpiry: .seconds(60 * 60 * 24 * 7)) #if DEBUG private static let disableCaching = ProcessInfo.processInfo.environment.keys.contains("DISABLE_IMAGE_CACHE")