title: NSURLSessionDataDelegate not called
body: <p>I have been trying to implement the NSURLSessionDataDelegate, in particular to modify the cache policies that are in the HTTP Headers received in the response.</p>
  
  <p>To do this I try to intercept the proposedResponse before it is cached by using the willCacheResponse method, but it does not get called.</p>
  
  <p>I looked on this website and others but still I am not sure why the function willCacheResponse is not called.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>class ViewController: UIViewController, NSURLSessionDelegate, NSURLSessionDataDelegate, NSURLSessionTaskDelegate {
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      let requestUrl = "https://www.google.com/data.json"
      let request = NSURLRequest(URL: NSURL(string: requestUrl)!)
      let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
  
      let session = NSURLSession(
          configuration: configuration,
          delegate: self,
          delegateQueue: NSOperationQueue.mainQueue()
      )
  
      let task = session.dataTaskWithRequest(request) {
          data, response, error in
  
          //print(data)
          print(response)
          //print(error)
      }
      task.resume()
  }
  
  func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, willCacheResponse proposedResponse: NSCachedURLResponse, completionHandler: (NSCachedURLResponse?) -&gt; Void) {
      print("willCacheResponse")
      completionHandler(proposedResponse)
  }
  }
  </code></pre>