-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
In ServiceWorker mode, render the page before extracting all resources #413
Comments
Yes, I noticed this render issue, easily reproducible with "Trigonometric Functions" in the latest Wikipedia mathematics ZIM. Or with "Paris" in full Wikipedia. I thought it was a case of waiting for the stylesheets, but since the same happens when revisiting the same page (with the stylesheets now cached), it must be a rendering delay. Did we introduce this issue with #385 ? Or has it always been that way? |
Ah, I've found an interesting difference! In Edge, in Service Worker mode, if you load a page by searching for it, we get the behaviour you describe. But if you load a page by clicking on a link in an article, I see the whole process of page composition, starting with the text and no stylesheet, then some images, then the stylesheets, etc. However, this isn't the case in Firefox Quantum. I haven't checked Chromium. It seems that Edge doesn't pause the rendering when clicking on a link, whereas Firefox does. When we load a page from the search field, then the article DOM is hidden, explaining why I don't see the composition process in Edge either in that case. But what causes it to render in Service Worker mode? Could we bring that moment forward in the process? EDIT: I confirm that Chromium behaves like Firefox, and IE doesn't support Service Worker, so irrelevant. |
Interesting. You're right about the fact that there's a different behavior between a click on a search result and a click on a link inside a page. Regarding the clicks on hyperlinks inside articles, it seems to me that Chromium does have the expected behavior : if you open a big wikipedia article (like the ones you were mentioning), and scroll to the bottom of the page as soon as it is displayed, you can see that the images appear afterwards. And the console logs seem to confirm that. On, Firefox, reading such big articles is much quicker, and they seem to have a different strategy. |
On wikipedia_fr_all_novid_2018-03.zim, if I try to open the article "Paris" :
In any case, I suppose we won't have much influence on the rendering strategy of the browsers. |
In ServiceWorker mode, the browser prioritize the requests by itself, just like #412 tries to do in jQuery mode : HTML, then CSS, then visible images, then other images.
But, for some reason, the page does not render before all images are read.
On big pages, it would be a much better user feeling to be able to read the beginning of it, while the rest is read from the ZIM file. Just like browsers do on any online page.
The text was updated successfully, but these errors were encountered: