#102 new
dave sailer

Issue with permanent cache write

Reported by dave sailer | November 18th, 2011 @ 06:46 PM

In certain cases, ASIDownloadCache fails to write content to the permanent cache. This is in the method "storeResponseForRequest:maxAge". I'm using ASIDownloadCache with ASICachePermanentlyCacheStoragePolicy along with ASIWebPageRequest and urlReplacementMode= ASIReplaceExternalResourcesWithLocalURLs.

In this scenario, the permanent cache file may already exist because it is initially written to by ASIHTTPRequest and then later rewritten by ASIWebPageRequest. Before the following line of code in ASIDownloadCache:

[[[[NSFileManager alloc] init] autorelease] copyItemAtPath:[request downloadDestinationPath] toPath:dataPath error:&error];

I added code to delete the file at dataPath before writing it and it seems to have fixed the problem.

Comments and changes to this ticket

  • dave sailer

    dave sailer November 19th, 2011 @ 01:19 PM

    Ok, I see now that this is fixed in the latest code. I was using the official v1.8.1. I think it might be good to updated the pages at http://allseeing-i.com/ASIHTTPRequest/ to help people understand the current state of the project. Is the lighthouse bug list even used? It seems only github is active. Is there going to be any official releases? I guess I will have to install the latest from github and test.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone

People watching this ticket