Page MenuHomePhabricator

Support Lazy loading of page content not needed for first paint
Closed, ResolvedPublic

Description

This is for the next generation of MCS/PCS (Page Content Service) page content.

In order to deliver just the content for the page - we should remove any content that can deferred until after first paint.
Additionally, most of the information being extracted will be expected to be rendered by the client using native code or js.

We shoud leave a placeholder in for any content removed from the page so we can identify where it came from:

  1. a class to signify that it is a placeholder so that clients could add onclick handlers if desired (class=mw-references-placeholder)
  2. an identifier of the extracted content so that clients can find the where it came from in the DOM

This is currently being worked out here:
https://docs.google.com/spreadsheets/d/1RoP3gzbd-DbthjTbfim5z-c-qgjKXJOQE5rgZH3k4d0/edit#gid=0

Currently we have the following for sure:

  • References
  • Page issues
  • Hatnotes
  • Categories

As part of this task we should figure out if we can deliver all of this information in a single API call or if we need to break it out into several APIs.

Event Timeline

@Jdlrobson Thanks for adding the link to the web team's measurements for lazy loading of references to the description. So, there is a significant savings for data but only a negligible improvement in time to first paint. Question: Do the data savings alone justify this effort?

That's the question to be asking. I think for web's traffic probably yes. The only thing blocking me turning it on is the performance of the mediawiki api.

In today's Services/Readers sync up @Jhernandez mentioned that the minimal gains for first paint the lazy loading gives is due to streaming on the web. The apps are not there yet to take advantage of streaming yet (hopefully in the future) -- so the performance gain of stripping references could be higher for apps until then. Sounds like web would like this anyways and I think the apps even more.

Change 362442 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] read-html: strip reference list contents

https://gerrit.wikimedia.org/r/362442

Fjalapeno renamed this task from Lazy load reference lists to Support Lazy load reference lists.Jul 14 2017, 3:52 PM

Change 362442 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] read-html: strip reference list contents

https://gerrit.wikimedia.org/r/362442

Mentioned in SAL (#wikimedia-operations) [2017-09-06T22:06:32Z] <bsitzmann@tin> Started deploy [mobileapps/deploy@507a479]: Update mobileapps to 2cb6281 (T168848 T169277 T169274 T162179 T164033 T167921 T174698 T168848 T174808)

Mentioned in SAL (#wikimedia-operations) [2017-09-06T22:11:25Z] <bsitzmann@tin> Finished deploy [mobileapps/deploy@507a479]: Update mobileapps to 2cb6281 (T168848 T169277 T169274 T162179 T164033 T167921 T174698 T168848 T174808) (duration: 04m 53s)

Jhernandez claimed this task.

This can be considered done for the current use cases. If there are other things to lazy load we can figure it out separately from the epic.