     /// `URLRequests` and the same processors. `URLRequests` are compared
     /// just by their `URLs`.
     public static func cacheKey(for request: Request) -> AnyHashable {
-        return request.cacheKey ?? AnyHashable(Key(request: request) {
+        return request.cacheKey ?? AnyHashable(makeCacheKey(request))
+    }
+    
+    private static func makeCacheKey(_ request: Request) -> Key {
+        return Key(request: request) {
             $0.container.urlString == $1.container.urlString && $0.processor == $1.processor
-        })
+        }
     }
 
     /// Returns a key which compares requests with regards to loading images.


/// Represents an image request.
public struct Request {
    public var urlRequest: URLRequest {
        get { return container.resource.urlRequest }
        set {

        }
    }

    /// Processor to be applied to the image. `Decompressor` by default.
    public var processor: AnyProcessor? {
        get { return container.processor }
