Does NSURLConnection take advantage of NSURLCache?

前端 未结 3 784
旧时难觅i
旧时难觅i 2020-12-28 21:12

I\'m trying to figure out how to use the URL loading framework to load URLs taking advantage of caching.

I am using NSURLConnections and feeding them NSURLRequests.

3条回答
  •  梦谈多话
    2020-12-28 21:20

    Have you tried messing with the connection:willCacheResponse: method? According to the URL Loading System documentation, "By default the data for a connection is cached according to the support provided by the NSURLProtocol subclass that handles the request. An NSURLConnection Delegationdelegate can further refine that behavior by implementing connection:willCacheResponse:."

提交回复
热议问题