Closed Bug 1001665 Opened 11 years ago Closed 11 years ago

Images blocking on something before loading

Categories

(Marketplace Graveyard :: Code Quality, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: clouserw, Unassigned)

References

Details

(Keywords: perf)

Originally from bug 987895: > > 6] starting at request 44 there is a run of images all requested together > > that have obviously been waiting for something to complete.. I bet that wait > > time can be moved up. how does include.js make its requests? i.e. does it > > try and do some kind of smart scheduling or does it go ahead and make the > > image requests as fast as it can? with spdy it should do the latter.
At the time this was written there was no smart scheduling: basically, we start rendering the main template, it contains a {% defer %} tag that does the XHR to the endpoint containing the apps, and when that XHR is received it modifies the DOM to add the apps to the page, which loads the images via regular <img> tags. Nowadays we've added deferred image loading, so this is no longer strictly true, ccing :ngoke so he can make the necessary additions to my comment. TL;DR: those images were waiting for the XHR that contains... the path to the images, so I don't think there is much we can do here, but I'm hoping to be proven wrong :)
Is this still true?
Flags: needinfo?(kngo)
That's true, the base page needs to be loaded and then the image deferrer needs to kick off before the images are actually requested.
Flags: needinfo?(kngo)
Priority: -- → P2
The answer is to send down only the critical JS (and CSS) so we get the XHRs back sooner, so we know the image URLs specified in the JSON responses, so we can request the images sooner. A lot of that should be solving with bug 1001665.
Is there anything left to do here ? We are loading images asynchronously on purpose, and only those visible or close to the viewport. We only know which images to load once they are present, which means we need the XHR and the template, so we have very little margin. > A lot of that should be solving with bug 1001665. You meant bug 1001666, right ? Or another one ? bug 1001665 is this very bug :-)
(In reply to Mathieu Pillard [:mat] from comment #5) > Is there anything left to do here ? We are loading images asynchronously on > purpose, and only those visible or close to the viewport. We only know which > images to load once they are present, which means we need the XHR and the > template, so we have very little margin. Agreed, I don't think there's much to do here. Any type of preloading I think is necessary given that we are already deferring images until they're visible. > > A lot of that should be solving with bug 1001665. > > You meant bug 1001666, right ? Or another one ? bug 1001665 is this very bug > :-) Yep, that's the one heh.
Closing as works for me since the deferring works as intended. Per comment 5 and 6, if we want to make the images (or really, all relevant resources for the current view, not just images) load earlier we'll do that in bug 1001666.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.