我正在使用ASIHTTPRequest并从服务器上提取内容,该服务器上有Squid缓存。似乎ASIHTTPRequest没有获得最新的内容版本。

如何告诉它忽略缓存,以便获得最新版本?还是有更好的方法来做到这一点?

以下是我正在使用的:

ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:serviceUrl];
[request setDownloadCache:[ASIDownloadCache sharedCache]];
[request setCachePolicy:ASIAskServerIfModifiedCachePolicy|ASIFallbackToCacheIfLoadFailsCachePolicy];
[request setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy];
[request setTimeOutSeconds:50.0];
[request addRequestHeader:@"CacheControl" value:@"no-cache"];
[request startSynchronous];

最佳答案

标题看起来应该是:

CacheControl: reload


那应该告诉squid从服务器获取请求,但这取决于squid服务器的配置。也许此功能已禁用?

您可以在浏览器中进行强制重新加载吗?

我认为无缓存只是意味着服务器不应更新其缓存。

关于iphone - ASIHTTPRequest-设置忽略缓存/代理,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5807140/

10-11 22:26
查看更多