Support Lazy Loading #2099

Closed
tae wants to merge 12 commits from gitlab-mr-iid-830 into develop
Member
  • before (41 images loaded)

before

  • after (12 images loaded)

after

- before (41 images loaded) ![before](/attachments/dcaa78eb-3758-4670-9d6a-f3e16275d35b) - after (12 images loaded) ![after](/attachments/d7112e60-8ac1-4443-8ae5-bb8f51ee3cda)
Owner

My testing of this on bikeshed results in much better bandwidth usage on mobile, especially when jumping between timelines and profiles, etc.

My testing of this on bikeshed results in much better bandwidth usage on mobile, especially when jumping between timelines and profiles, etc.
Member

is it possible to use @lazyLoaded="handleImageLoaded" attribute instead of manually adding/removing listeners?

is it possible to use `@lazyLoaded="handleImageLoaded"` attribute instead of manually adding/removing listeners?
Author
Member

I've refactored it using a built-in feature of the library. It was difficult to find it since it is not documented.

I've refactored it using a built-in feature of the library. It was difficult to find it since it is not documented.
Author
Member

@hj bump

@hj bump
Member

I'll check it out tomorrow.

I'll check it out tomorrow.
Member
  • images load very weird, even if it's just same image that's already been loaded (i.e. user avatars) there's still weird delay before it's shown
  • precached nsfw images also have this additional delay
  • weird delay when opening up lightbox
  • doesn't always work with play-on-hover GIFs:
    image
* images load very weird, even if it's just same image that's already been loaded (i.e. user avatars) there's still weird delay before it's shown * precached nsfw images also have this additional delay * weird delay when opening up lightbox * doesn't _always_ work with play-on-hover GIFs: ![image](/attachments/6b511053-cea9-4df7-909c-c1b7a20fe648)
Member

overall it makes whole UI feel MUCH more janky while not giving too much of a benefit except for bandwidth savings which is questionable and if you really care about it, you can hide attachments in settings.

I say if you really want it:

  • make it work ONLY on attachments in timeline - not viewbox, not user avatars, ONLY attachments.
  • fix play-on-hover gifs
  • make it configurable in options with instance default
overall it makes whole UI feel MUCH more janky while not giving too much of a benefit except for bandwidth savings which is questionable and if you really care about it, you can hide attachments in settings. I say if you ***really*** want it: * make it work ONLY on attachments in timeline - not viewbox, not user avatars, ONLY attachments. * fix play-on-hover gifs * make it configurable in options with instance default
Owner
  • images load very weird, even if it's just same image that's already been loaded (i.e. user avatars) there's still weird delay before it's shown

I can't reproduce this on Social. What kind of latency do you have between your client and server?

  • precached nsfw images also have this additional delay

I also can't reproduce this on Social

  • weird delay when opening up lightbox

If the image hasn't been downloaded yet, there is a delay... but that shouldn't happen for you because the image in the timeline is the same in the lightbox. On Social we have two images -- low res for timeline; high res for lightbox -- so there is a delay, but it's less than what I see on most servers and not as bad as I've seen on Mastodon.social

  • doesn't always work with play-on-hover GIFs:

Will have to investigate. We don't have GIFs on Social. All GIFs are converted to looping MP4 videos.

> * images load very weird, even if it's just same image that's already been loaded (i.e. user avatars) there's still weird delay before it's shown I can't reproduce this on Social. What kind of latency do you have between your client and server? > * precached nsfw images also have this additional delay I also can't reproduce this on Social > * weird delay when opening up lightbox If the image hasn't been downloaded yet, there is a delay... but that shouldn't happen for you because the image in the timeline is the same in the lightbox. On Social we have two images -- low res for timeline; high res for lightbox -- so there is a delay, but it's less than what I see on most servers and not as bad as I've seen on Mastodon.social > * doesn't *always* work with play-on-hover GIFs: Will have to investigate. We don't have GIFs on Social. All GIFs are converted to looping MP4 videos.
Member

I can't reproduce this on Social. What kind of latency do you have between your client and server?

on develop images load nearly instantly, on this branch they take their time loading because they don't start loading IMMEDIATELY when browser knows about them.

but that shouldn't happen for you because the image in the timeline is the same in the lightbox.

yet it somehow happens, but i'm not entirely sure, might be unrelated.

Will have to investigate. We don't have GIFs on Social. All GIFs are converted to looping MP4 videos.

how disgusting, would you kindly stop?

>I can't reproduce this on Social. What kind of latency do you have between your client and server? on develop images load nearly instantly, on this branch they take their time loading because they don't start loading IMMEDIATELY when browser knows about them. >but that shouldn't happen for you because the image in the timeline is the same in the lightbox. yet it somehow happens, but i'm not entirely sure, might be unrelated. >Will have to investigate. We don't have GIFs on Social. All GIFs are converted to looping MP4 videos. how disgusting, would you kindly stop?
Owner

how disgusting, would you kindly stop?

no, we like our users' battery and bandwidth to be preserved 😆

> how disgusting, would you kindly stop? no, we like our users' battery and bandwidth to be preserved :laughing:
Member

play-on-hover is a thing you know. i did that specifically for that purpose

play-on-hover is a thing you know. i did that specifically for that purpose
Owner

Wouldn't that only save CPU? Play-on-hover would still require the file to be downloaded to show the first frame. Perhaps I'm misunderstanding what you mean.

But also you can't "hover" on mobile 😓

Wouldn't that only save CPU? Play-on-hover would still require the file to be downloaded to show the first frame. Perhaps I'm misunderstanding what you mean. But also you can't "hover" on mobile 😓
Member

on mobile you click. for most gifs it doesn't make much differnce since you'll most likely will be seeing the whole thing anyway. it saves cpu a bit. video conversion however disallows you to upload the original gif (which is much more useful especially for image manipulation) (except if you zip it to overcome the limitation (which isn't always an option on mobile)), degrades quality, breaks seamless loops and destroys transparency.

on mobile you click. for most gifs it doesn't make much differnce since you'll most likely will be seeing the whole thing anyway. it saves cpu a bit. video conversion however disallows you to upload the original gif (which is much more useful especially for image manipulation) (except if you zip it to overcome the limitation (which isn't always an option on mobile)), degrades quality, breaks seamless loops and destroys transparency.
Author
Member

fixed @hj

fixed @hj

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma-fe!2099
No description provided.