     /* Omit the session parameter to use the default URLSession */
     public init(session: URLSession? = nil) {
         urlSession = session
-        request = NSMutableURLRequest()
+    }
+
+    private static var _sessionConfig: URLSessionConfiguration?
+    private static var sessionConfig: URLSessionConfiguration {
+        guard _sessionConfig == nil else { return _sessionConfig! }
+        _sessionConfig = URLSessionConfiguration.default
+        // FYI, from Apple's documentation: NSURLSession won't attempt to cache a file larger than 5% of the cache size
+        // https://goo.gl/CpVNqZ
+        return _sessionConfig!
+    }
+
+    open static var maxEstimatedResponseMegabytes: Int = 5 {
+        didSet { updateSessionConfig() }
+    }
+
+    private static var urlSession: URLSession! = nil
+
+    private static func updateSessionConfig() {
+        sessionConfig.requestCachePolicy = requestCachePolicy
+        sessionConfig.timeoutIntervalForResource = resourceTimeout
+        sessionConfig.timeoutIntervalForRequest = requestTimeout
+        let capacity: Int = (maxEstimatedResponseMegabytes * 20) * 1024 * 1024 // max response should be less than 5% of cache size
+        let urlCache = URLCache(memoryCapacity: capacity, diskCapacity: capacity, diskPath: nil)
+        sessionConfig.urlCache = urlCache
+        urlSession = URLSession(configuration: JSONRequest.sessionConfig)
     }
 
     // MARK: Non-public business logic (testable but not public outside the module)

                                                body: self.body(fromData: data))
                complete(result)
                return
            }
            let result = self.parse(data: data, response: response)
            complete(result)
        }
        trace(task: task)
        task.resume()
    }

    func networkSession(forcedTimeout: TimeInterval? = nil) -> URLSession {
        let config = URLSessionConfiguration.default
        config.requestCachePolicy = JSONRequest.requestCachePolicy
        config.timeoutIntervalForRequest = forcedTimeout ?? JSONRequest.requestTimeout
        config.timeoutIntervalForResource = forcedTimeout ?? JSONRequest.resourceTimeout
        if let userAgent = JSONRequest.userAgent {
            config.httpAdditionalHeaders = ["User-Agent": userAgent]
        }
        return URLSession(configuration: config)
    }

    func submitSyncRequest(method: JSONRequestHttpVerb, url: String,


        log("<<<<<<<<<< JSON Response <<<<<<<<<<")
        log("Time Elapsed: \(elapsed)")
        if let url = httpResponse?.url {
            log("Url: \(url.absoluteString)")
            log("PATH: \(url.path)")
            let apiTripObject = APITripTimeObject(path: url.path, tripTime: elapsed)
