我使用EVURLCache即使緩存控制和附註頭被定義POST請求響應緩存:如何防止EVURLCache使用Cache-Control標頭緩存請求?
Headers: [
Access-Control-Allow-Headers : Content-Type, Accept, X-Requested-With, remember-me, x-auth-token
Content-Type : application/json;charset=UTF-8
Access-Control-Max-Age : 3600
Cache-Control : no-cache, no-store, max-age=0, must-revalidate
Server : nginx/1.9.15
Connection : keep-alive
Transfer-Encoding : Identity
X-XSS-Protection : 1; mode=block
X-Content-Type-Options : nosniff
Expires : 0
X-Application-Context : application:dev,docker:8080
Pragma : no-cache
Access-Control-Allow-Methods : POST, GET, OPTIONS, DELETE, PUT
Date : Thu, 18 Aug 2016 13:57:15 GMT
Access-Control-Allow-Origin : *
Access-Control-Allow-Credentials : true
]
如何強制EVURLCache不緩存這樣的要求?
我用下面的代碼初始化緩存在我的應用程序委託:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// configuring cache
EVURLCache.LOGGING = true // We want to see all caching actions
EVURLCache.activate()
return true
}
注意,我知道過濾器,但我不知道,如果我們可以告訴它跟隨的響應頭建議緩存行爲
用相關代碼更新您的問題。 – rmaddy
更新爲AppDelegate代碼 –
如果發生完全相同的問題,請與EVURLCache的創建者打開一個問題 https://github.com/evermeer/EVURLCache/issues – SoundShock