-
Notifications
You must be signed in to change notification settings - Fork 247
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
UIWebView caching failure for iOS>5.0 #34
Comments
I tested on iOS 5.1.1 on both device and simulator, and |
I am testing on iOS 5.1 on device/simulator. I have a simple View Controller with a UIWebView. I first run the app with an internet connection and the response is being cached. Then I run the app without an internet connection and the UIWebView does not load the html response. The webView delegate method webView:didFailLoadWithError: is being called with error'The Internet connection appears to be offline.' I have set the cache-control:max-age header. However, when I do the same tests using the iOS 4.3 simulator, the UIWebView presents the html response both in online and offline mode. |
Just performed the very same test, worked well with iOS 5. I used this URL: http://rs.rhapsodyk.net/test/cache.html. Here is the test app: http://dl.dropbox.com/u/123346/SDURLCacheTest.zip. |
Interesting... I if I change your url with mine it doesn't work so it must have something to do with the response headers. Since I am not allowed to give you the actual url so that you can see for your self, could you please take a look at the response headers and tell me if you can think of anything? http://dl.dropbox.com/u/16899725/headers.png . The funny thing is that as I mentioned before, it works with iOS 4.3, meaning it works with SDURLCache. |
You may try to add |
When the fallback to NSURLCache happens (iOS>5.0) caching for UIWebViews does not work. I assume it is because NSCachedURLResponse coming from an UIWebView has a storagePolicy set to NSURLCacheStorageAllowedInMemoryOnly as discussed here: #1 .
The text was updated successfully, but these errors were encountered: