Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios ASIHTTPRequest仅为一个URL清除缓存_Ios_Caching_Asihttprequest - Fatal编程技术网

Ios ASIHTTPRequest仅为一个URL清除缓存

Ios ASIHTTPRequest仅为一个URL清除缓存,ios,caching,asihttprequest,Ios,Caching,Asihttprequest,我正在使用带缓存的ASIHTTPRequest在iOS应用程序中下载图片。大多数图片从不更改,因此可以利用缓存功能。iOS应用程序中的某些功能确实会发生变化。所以,我确切地知道这些图像什么时候会改变。如何清除某个链接(例如)的缓存,并为应用程序中的所有其他请求保留缓存。谢谢 ASIHTTPRequest *request; request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"{Image url}"]]; [reques

我正在使用带缓存的ASIHTTPRequest在iOS应用程序中下载图片。大多数图片从不更改,因此可以利用缓存功能。iOS应用程序中的某些功能确实会发生变化。所以,我确切地知道这些图像什么时候会改变。如何清除某个链接(例如)的缓存,并为应用程序中的所有其他请求保留缓存。谢谢

ASIHTTPRequest *request;
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"{Image url}"]];
[request setDownloadCache:[ASIDownloadCache sharedCache]];
[request setCachePolicy:ASIAskServerIfModifiedWhenStaleCachePolicy|ASIFallbackToCacheIfLoadFailsCachePolicy];
[request setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy];
[request setSecondsToCache:60*60*24*7];
[[ASIDownloadCache sharedCache] removeCachedDataForURL:[NSURL URLWithString:@"{Image url}"]];