         if NSURLProtocol.propertyForKey(URLProtocolHandledRequestKey, inRequest: request) != nil {
             return false
         }
-        
+
         if let avoidCache = NSURLProtocol.propertyForKey(MattressAvoidCacheRequestPropertyKey, inRequest: request) as? Bool {
             // We've flagged this request to avoid retreiving from cache
             if avoidCache == true {

let cacheLockObject = NSObject()

private let URLProtocolHandledRequestKey = "URLProtocolHandledRequestKey"

/**
    URLProtocol is an NSURLProtocol in charge of ensuring

        }

        let scheme = request.URL?.scheme
        if scheme == "http" || scheme == "https" {
            if shouldRetrieveFromOfflineCacheByDefault {
                return true
            } else if let cache = NSURLCache.sharedURLCache() as? URLCache {
                if let handler = cache.isOfflineHandler {
                    return handler()
                }
            }
        }
        return false
    }

    /**
