What's the optimal file size for a looping HTML5 background?

南楼画角 提交于 2019-12-06 04:46:13

According to the Akami 2014 internet speed ratings, the world average internet speed is 3.9Mbps (That's about 500KB per second or half a megabyte). However, I would strongly suggest not aiming for average, but aiming below average for optimization so that even more people have a pleasant experience on your site. I would suggest aiming to optimize for speeds around 1.5Mbps (about 185KB per second). That means if you want your page to load in a reasonable 10 seconds on a slow 1.5Mb connection, uncached (the first time someone visits your site, it will speed up as images are cached) your total page should be less then 2MB. So you have to ask yourself how much of that 2MB are you willing to use on a background image? I would suggest aiming for around 150-300Kb for a background image. Use a program like Photoshop and the "Publish to Web" feature to play with your background images settings and file types to change it's size to what you want. I suggest avoiding Jpeg and aiming for PNG.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!