A key factor for the load time of a web page is the file size of the HTML file and the images and scripts contained therein. File sizes should be kept as small as possible, especially for mobile web pages. The size of a digital file is specified in kilobytes, megabytes, or gigabytes. It is often recommended that the sum of the files should not exceed a 100 KB limit, but that is almost impossible for modern websites.
Depending on the file, its size depends on various factors.
File size can only be reduced by a proper, server-side compression of all files. This mainly affects HTML and script files. In JPG format, images are already compressed (lossy). You need to adjust the picture format to the layout and not scale it in the browser with the attributes “width” and “height.” Moreover, it is usually sufficient when images are output with 80 percent quality and 72 dpi, since browsers do not display better quality anyway.
Media that is inserted into websites, should generally get compressed beforehand to keep the load time as short as possible. This is especially true for images and videos. In some cases, it is advisable to work with iframes, so that the file does not have to be loaded from your server. Websites with a lot of images or videos can also use a Content Delivery Network so as not to affect the load time.
File size is an important component of on-page optimization since it is closely associated with the load time of a website. Load time is an important ranking factor. The compression of image files therefore is a task that should be on the SEO to-do list. With optimization tools such as Google’s Page Speed, SEOs can get information on potential for optimization in terms of file size and other metrics.
In a broader sense, file size is also a factor for images SEO, because special file formats and specific sizes of images are preferred by the Googlebot. Moreover, file size affects ranking as part of Google’s and other search engines image search.
In mobile optimization, the file size should also be taken into account, since large files require too much memory resources on mobile devices even in the LTE era.
Server costs may vary depending on the file sizes used. If a website gets a lot of traffic and works with numerous images, minimal savings on file sizes can constitute considerable savings in required data volume and consequently also affect the cost of web hosting.