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