[問題] 請問有關UseProtocolCachePolicy

看板MacDev作者 (呼啦啦~)時間7年前 (2017/06/28 09:12), 7年前編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
找到另一篇解釋更詳細的 http://www.jianshu.com/p/aa49bb3555f4 =========================== 最近在研究cache的機制 看了這篇 http://nshipster.cn/nsurlcache/https://developer.apple.com/documentation/foundation/nsurlrequest.cachepolicy/1411223-useprotocolcachepolicy 還是沒有搞懂 想問一下 如果我cache設定為useProtocolCachePolicy, 大小也配置好了。 Server的回應Header裡也有設定Cache-Control 程式就會依照Cache-Control設定好的時間存cache嗎? PS.這篇有提到一點 http://www.hpique.com/2014/03/how-to-cache-server-responses-in-ios-apps/ The shared NSURLCache gives us much out of the box. If our server uses Cache-Control HTTP headers a sets the maximum age for its responses, both the shared NSURLSession (iOS 7 only) and NSURLConnection will respect this and return cached responses before they expire. We don’t need to write any code to get this functionality 但在Apple的文件我是找不到,希望有經驗的人能指導一下 3Q -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.32.190.119 ※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1498612359.A.FA7.html ※ 編輯: fightword (114.32.190.119), 06/28/2017 09:17:36 ※ 編輯: fightword (114.32.190.119), 06/30/2017 11:48:59
文章代碼(AID): #1PKmA7-d (MacDev)