-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache in offline #18
Comments
Hello, thanks for sharing your solution. I'm trying to do the same but I'm getting error 301 (permanently moved). Am I missing anything? |
I don't know. |
Ok, it was all about the ISS server I'm working with. Cheers |
Hi dqueffeulouatw I'm a little bit late here, but I recently had the same problem as you (I was not using SDURLCache) but the task I tried to solve was the same. After lots of searching I now found a solution, by implementing my own NSURLProtocol subclass, and not using the cache at all. At least for the injection of the local resources. See http://stackoverflow.com/a/9390792/117959 for more information. cheers |
…hods Don't mix non-keyed archiver methods with keyed archiver methods.
Hi,
This is not a bug but a comment about offline use of SDURLCache.
I'm trying to use SDURLCache to make an offline cache for UIWebView. Actually it doesn't work as in offline I get an error "no connexion available" (no sure about the english message). Code=-1009.
So what I did to solve this problem is to change the cachedResponseForRequest: method to create a new NSCachedURLResponse from the cache instance. This trick works for almost all resources except the JQuery AJAX request because it seems that the statusCode returned is 0.
I tried much modifications to make it work but actually I cannot solve this problem :
I tried to subclass NSHTTPURLResponse to force statusCode to 0 => statusCode is never called
I tried a category on NSURLResponse which implements statusCode => statusCode is called so I can return 200 but jquery still get a 0 status
So I don't know how to control the final response from the cache to the client, mainly the statusCode and the headers.
If you have any information about this, I might be interested.
If you are interested by the changes I made, the code is :
The text was updated successfully, but these errors were encountered: