         case .Limit(let bytes):
             assert(bytes > 0, "Invalid memory capacity, .Limit's bytes value should be greater than zero or use .Disable")
             self.memoryCache.totalCostLimit = bytes
+            
+            #if os(iOS)
+                memoryWarningObserver = NSNotificationCenter.defaultCenter().addObserverForName(
+                    UIApplicationDidReceiveMemoryWarningNotification,
+                    object: UIApplication.sharedApplication(),
+                    queue: nil,
+                    usingBlock: { [weak self] (notification) -> Void in
+                        self?.removeAllResponsesCachedInMemory()
+                        return
+                    }
+                )
+            #endif
         }
         self.memoryCache.evictsObjectsWithDiscardedContent = true
         


import Foundation

public class URLCacheProvider: NSObject, Provider {
    
    public enum MemoryCapacity {

        }
    }
    
    deinit {
        if let observer: AnyObject = memoryWarningObserver {
            NSNotificationCenter.defaultCenter().removeObserver(observer)
        }
    }
    
    // MARK: -
    
    private let memoryWarningObserver: AnyObject?
    
    public func responseForRequest(request: Request, completion: (response: Response) -> Void) {
        let urlRequest = request.toNSURLRequest()
