             return
         }
 
-        updateRequest(method: method, url: url, queryParams: queryParams)
-        updateRequest(headers: headers)
-        updateRequest(payload: payload)
-
-        let session = urlSession ?? networkSession(forcedTimeout: timeOut)
+        var request = URLRequest(url: URL(string: url)!,
+                                 cachePolicy: JSONRequest.requestCachePolicy,
+                                 timeoutInterval: timeOut ?? 10.0)
+
+        updateRequest(&request, method: method, url: url, queryParams: queryParams)
+        updateRequest(&request, headers: headers)
+        updateRequest(&request, payload: payload)
+
+        let session = (timeOut == urlSession?.configuration.timeoutIntervalForRequest
+            ? (urlSession ?? networkSession())
+            : networkSession(forcedTimeout: timeOut))
         let start = Date()
-        let task = session.dataTask(with: request! as URLRequest) { (data, response, error) in
+
+        let cachedResponse: CachedURLResponse? = session.configuration.urlCache?.cachedResponse(for: request)
+        if cachedResponse == nil {
+            removeCachingHeaders(&request)
+        }
+
+        let task = session.dataTask(with: request) { (data, response, error) in
             let elapsed = -start.timeIntervalSinceNow
             self.traceResponse(elapsed: elapsed, responseData: data,
                                httpResponse: response as? HTTPURLResponse,

        return requestResult
    }

    func updateRequest(method: JSONRequestHttpVerb, url: String,
                       queryParams: JSONObject? = nil) {
        request?.url = createURL(urlString: url, queryParams: queryParams)
        request?.httpMethod = method.rawValue
    }

    func updateRequest(headers: JSONObject?) {
        request?.setValue("application/json", forHTTPHeaderField: "Content-Type")
        request?.setValue("application/json", forHTTPHeaderField: "Accept")
        if let headers = headers {
            for (headerName, headerValue) in headers {
                request?.setValue(String(describing: headerValue), forHTTPHeaderField: headerName)
            }
        }
    }

    func updateRequest(payload: Any?) {
        guard let payload = payload else {
            return
        }
        request?.httpBody = objectToJSON(object: payload)
    }

    open func createURL(urlString: String, queryParams: JSONObject?) -> URL? {

                                                body: self.body(fromData: data))
                complete(result)
                return
            } else if let httpResponse = (response as? HTTPURLResponse),
                httpResponse.statusCode == 304,
                let cachedResponseObj = cachedResponse {
                /*  For some rediculous reason, there are cases where the cache contains a response for the HTTP request (as verified
                 by the conditional check above), but that cached response isn't passed transparently to us as a 200OK response, and is
                 instead a 304, which throws the consumer out of wack since there's no guarantee they have cached the data themselves.

                 So, if we got a 304, AND we have a cached response object, let's parse & process that instead here. Yay for caching >:-(
                 */
                print("Unexpected 304 returned when a cached value exists. Parsing & returning cached response")
                self.traceResponse(elapsed: elapsed, responseData: cachedResponseObj.data,
                                   httpResponse: cachedResponseObj.response as? HTTPURLResponse,
                                   error: error as NSError?)
                let result = self.parse(data: cachedResponseObj.data, response: cachedResponseObj.response)
                complete(result)
            } else {
                let result = self.parse(data: data, response: response)
                complete(result)
            }
        }
        trace(task: task)
        task.resume()
    }

    func networkSession(forcedTimeout: TimeInterval? = nil) -> URLSession {
        let config = JSONRequest.sessionConfig
        if let timeout = forcedTimeout {
            config.timeoutIntervalForRequest = timeout
            config.timeoutIntervalForResource = timeout
        }
        let session = URLSession(configuration: config)
        if forcedTimeout == nil {
            // if there isn't a custom timeout, set the member variable with this new session we've created for future use.
            urlSession = session
        }
        return session
    }

    func submitSyncRequest(method: JSONRequestHttpVerb, url: String,
