Skip to content
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

Data saving mode #675

Open
sombresu opened this issue Aug 21, 2023 · 10 comments
Open

Data saving mode #675

sombresu opened this issue Aug 21, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@sombresu
Copy link

Is your feature request related to a problem? Please describe.
Limited data plan on a third world country. Also as soon as the app is opened, It uses so much data.

Describe the solution you'd like
Reduce image preview
Not auto buffering videos an gifs
Reduce video resolution

@CTalvio
Copy link
Collaborator

CTalvio commented Aug 23, 2023

This will be difficult. Lemmy does not currently provide lower quality versions of media for a lot of stuff, as it is often not even hosted on the instance. As such, its not possible to just "reduce resolution" of content to save data use.

@hjiangsu hjiangsu added the enhancement New feature or request label Sep 5, 2023
@hjiangsu
Copy link
Member

hjiangsu commented Sep 5, 2023

Yeah, as @CTalvio mentioned, it would be a bit difficult to reduce data usage down at this point in time because there's no option to change the quality of the images/media that is retrieved from lemmy.

One way to reduce data consumption is to reduce the amount of posts that get loaded in, or to do some further optimizations on our caching and network calls. However, this will take some time to do and this will only continue to get better over time as we continue working on Thunder! Reducing the amount of posts that get loaded in is also fairly minimal in terms of data usage so it would not improve data consumption much.

An extreme alternative would be to host our own servers which downscale the images and act as a proxy between the app and the lemmy instance. However, this brings in a whole new level of complexity and issues which would be best to avoid at this point in time.

@CTalvio
Copy link
Collaborator

CTalvio commented Sep 5, 2023

It might be worth adding a setting to not load images for use in thumbnails at all.

@hjiangsu
Copy link
Member

hjiangsu commented Sep 5, 2023

That's a good idea, that would definitely help alleviate data usage. Maybe this can be grouped as a setting for "Data Saving Mode" along with any other tweaks such as loading less posts/comments/etc.

@micahmo @ajsosa thoughts on other suggestions for lowering data usage?

@CTalvio
Copy link
Collaborator

CTalvio commented Sep 8, 2023

I have discovered, that at least with images hosted on a lemmy instance, we in fact can request lower resolution images.

This image hosted on sopuli.xyz, can be requested in a variety of resolutions by using ?thumbnail=512&format=webp as a query string.

For example: https://sopuli.xyz/pictrs/image/cd319103-2136-48d5-a326-fb0afed527b0.png?thumbnail=512&format=webp for 512p height image.

64p
https://sopuli.xyz/pictrs/image/cd319103-2136-48d5-a326-fb0afed527b0.png?thumbnail=64&format=webp
128p
https://sopuli.xyz/pictrs/image/cd319103-2136-48d5-a326-fb0afed527b0.png?thumbnail=128&format=webp
256p
https://sopuli.xyz/pictrs/image/cd319103-2136-48d5-a326-fb0afed527b0.png?thumbnail=256&format=webp
512p
https://sopuli.xyz/pictrs/image/cd319103-2136-48d5-a326-fb0afed527b0.png?thumbnail=512&format=webp
1024p
https://sopuli.xyz/pictrs/image/cd319103-2136-48d5-a326-fb0afed527b0.png?thumbnail=1024&format=webp

@CTalvio
Copy link
Collaborator

CTalvio commented Sep 8, 2023

Further discovery. I have investigated this more, and it works even with images hosted outside a lemmy instance. The instance does in fact cache thumbnails even for externally hosted media, though not for all file types.

Still, this will allow for a significant reduction in data use!

@hjiangsu
Copy link
Member

hjiangsu commented Sep 8, 2023

Oh wow, I didn't know that was possible either - do you know if the parameter is for width or height? It seems like its width, but thats just an assumption!

@CTalvio
Copy link
Collaborator

CTalvio commented Sep 8, 2023

Oh wow, I didn't know that was possible either - do you know if the parameter is for width or height? It seems like its width, but thats just an assumption!

It is for height. I discovered this because I went investigating why posts sometimes had low resolution on my Photon instance. The taller images get much less resolution for their width with the same 512p height regardless of aspect ratio.

@Blisterexe
Copy link

not to necropost, but id love the option to not load images at all when on data, because i have 500mb of data, and images eat that very fast

@hjiangsu
Copy link
Member

@Blisterexe

I believe that is an existing issue here: #352. I'll see if I have the time to get to it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants