我使用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