amphtml
amphtml copied to clipboard
[Story format] Greatly increase timeout before dispatching "storyContentLoaded" event
The storyContentLoaded event has the same timeout as the amp-story-renderer service, which is 2900ms. This event is used by Players to know when the initial content is loaded.
Use cases include:
- The open source Story Web Player uses it as a heuristic to start prerendering the following story
- Some players could use it to show an animation (eg: loading spinner) or a preview before revealing the fully loaded content
(1) makes performance really bad because on a slow initial story load, we'd bloat the network even more by prerendering the next story. (2) just doesn't work for half the users, as the story would get revealed too early because of the timeout.
We should keep a timeout for code safety, I suggest 8000ms which seems to be the 95th percentile according to the metrics we have.
cc @ampproject/wg-stories
8k LGTM