当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - PHP Cache not working when using Heroku with AFNetworking

问题描述:

I've built some simple GET webservice using PHP that return some JSON. I've tested on my local and cache is working perfectly fine. But when I deploy to Heroku, the cache simple doesn't work.

I made few tests, and the server is returning perfectly fine all the cache headers:

Heroku Headers response got from AFNetworking:

"Cache-Control" = "public, max-age=86400";

Connection = "keep-alive";

"Content-Type" = "application/json";

Date = "Sat, 20 Jun 2015 05:10:20 GMT";

Server = "Apache/2.4.10 (Unix)";

"Transfer-Encoding" = Identity;

Via = "1.1 vegur";

"X-Powered-By" = "PHP/5.6.10";

Local server headers from AFNetworking:

"Cache-Control" = "public, max-age=86400";

Connection = "Keep-Alive";

"Content-Length" = 1711;

"Content-Type" = "application/json";

Date = "Sat, 20 Jun 2015 05:11:39 GMT";

"Keep-Alive" = "timeout=5, max=98";

Server = "Apache/2.4.10 (Unix) OpenSSL/1.0.1j PHP/5.6.3 mod_perl/2.0.8-dev Perl/v5.16.3";

"X-Powered-By" = "PHP/5.6.3";

Also, NSCachedURLResponse always return nill from my Heroku URL.

Does anyone have any ideia about this?

Btw: Using iOS 8.3 SDK.

分享给朋友:
您可能感兴趣的文章:
随机阅读: