Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
better performance web graphics and images
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Ciss1965
n00b
n00b


Joined: 26 Mar 2024
Posts: 1

PostPosted: Tue Mar 26, 2024 5:17 pm    Post subject: better performance web graphics and images Reply with quote

How do you optimize web graphics and images for better performance and faster loading times?
Back to top
View user's profile Send private message
Kresni
n00b
n00b


Joined: 30 Apr 2023
Posts: 22
Location: 46E 53N

PostPosted: Fri Mar 29, 2024 11:03 pm    Post subject: Reply with quote

This is a rather vague question as the answer changes depending on what you are actually trying to do. First of all, you can start by using an image format that focuses on making more efficient use of data, such as jpg or webp.

If your image does not contain a lot of detail, even if it is higher quality, those who visit your website are unlikely to notice it. So, you can decrease the quality of your pictures provided that you have access to a image manipulation software (like GIMP).

Additionally, more often than not, image files contain extra information (such as metadata and other EXIF data, comments, thumbnails, or additional information that could be understood by image displaying software). If this file will sit inside your server and only be used to display something on a webpage, you probably do not need these things, meaning that you can omit them while processing your image file. This will save you same space, but nothing crazy.

However, keep in mind that leaving some of that information out may create issues with older software (they may not be able to view the file). Image processing is a rather complex topic, I would encourage you to read documentation for your specific use case. To get a general idea, I can recommend the following:



_________________
~~~~
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3477

PostPosted: Sat Mar 30, 2024 7:35 pm    Post subject: Reply with quote

Quote:
How do you optimize web graphics and images for better performance and faster loading times?
It depends.
Webp is a good start, since they tend to be significantly smaller than jpeg, with no visible quality difference.
Websites load in bursts, so keepalive and pipelining multiple requests over a single connection speeds things up (enabled by default since HTTP/1.1, but there are ways AND reasons to break it).
When you grow your scale of operations, you might notice some patterns in your traffic. And then, you optimize the delivery network. Like adding caching proxies in the areas where groups of visitors come from.
Or even just adding caching proxies for static files (like images) to serve them with something cheaper than the application server. Many people e.g. run apache+php (webapp) behind nginx (static images + proxy to app for dynamic content). Those 2 are similar enough this setup looks dumb to me, bur once upon a time it used to actually make sense (though I have no idea whether or not it still does today).
If you have enough traffic to serve it from multiple servers, you might segregate the traffic to pull the same images from the same machine at all times, this will let you hit in-ram caches more often instead of re-reading stuff from disks all the time while freeing respective amount of RAM from the other server making it available for other tasks.

In the end however, it will probably be cheaper to just throw more money at the problem. Most people just don't run operations at such a big scale. Which breeds bad habits, but then again, "done is better than perfect".
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2189

PostPosted: Sun Aug 04, 2024 1:25 pm    Post subject: Re: better performance web graphics and images Reply with quote

Ciss1965 wrote:
How do you optimize web graphics and images for better performance and faster loading times?

Probably not a problem for this audience, but most web pages suck because they use too much JavaScript - largely because they're written using Windows programs to "simplify" the task of writing HTML.
_________________
Greybeard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum