Skip to content
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

Some web pages cant be opened in webView after caching - redirect issue #35

Open
ChristRm opened this issue Nov 11, 2016 · 8 comments
Open

Comments

@ChristRm
Copy link

Try to load demo demo app with webView with any of links below instead of "http://evict.nl":

http://www.newser.com/story/229485/aetna-doing-something-about-workers-student-loans.html
http://www.beckershospitalreview.com/payer-issues/when-the-doctor-orders-time-in-the-park-humana-metcare-partner-for-nature-driven-prescriptions.html
http://www.beckershospitalreview.com/healthcare-information-technology/10-largest-hipaa-settlement-fines.html

After this turn off internet connection and open app again.
Expected result: web page is loaded from cache and displayed
Actual result: web page is failed to be opened

Same behaviour appears for some other urls but not for all.

@evermeer
Copy link
Owner

I will have a look at these url's later today.

@evermeer
Copy link
Owner

evermeer commented Nov 12, 2016

Since these are all http pages, dit you set the 'Allow Arbitrary Loads' to yes in your info.plist?

Ah, I think i found your problem. For a lot of request the data is returned with Cache-Control=no-cache
Because of these the files are not written to the cache folder. Maybe we should add a ignoreCacheControl flag?

@evermeer
Copy link
Owner

I have added the option EVURLCache.IGNORE_CACHE_CONTROL which you could set to true if you like.

@ChristRm
Copy link
Author

ChristRm commented Nov 17, 2016

Yes, I did set 'Allow Arbitrary Loads'.
No, it don't fixed the problem, urls still don't work. Try to run project in online and then in offline.
EVURLCache.zip

@ChristRm ChristRm reopened this Nov 17, 2016
@ChristRm
Copy link
Author

Are there any news with this issue?

@evermeer
Copy link
Owner

It looks like you initially need to load the pages with m. instead of www.
The initial redirect is not picked up by the URLCache.
I will try to find a workaround for that.

@evermeer evermeer removed the fixed? label May 14, 2017
@evermeer
Copy link
Owner

using an URLProtocol for capturing redirects seems to have some problems. Redirects can be detected, but when offline it seems impossible to return a redirect value.

@evermeer evermeer changed the title Some web pages cant be opened in webView after caching Some web pages cant be opened in webView after caching - redirect issue May 14, 2017
@evermeer
Copy link
Owner

Does anyone have an idea how You could let a URProtocol or URLCache return a redirect. It looks like I am not able to instantiate a redirect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants