大网数据广告活动
网站运营与故障问答

Server Load: Image Downloading vs. Image Viewing

· 52CE 我爱测

I think my question is fairly simple, but being a bit of a newbie I don't know the answer and I haven't been able to find a satisfactory one searching online. If I have a 25kb page (html) that displays a 75kb image, does that amo…

问题原文

原帖链接 · Rob Jay · CC BY-SA 4.0

I think my question is fairly simple, but being a bit of a newbie I don't know the answer and I haven't been able to find a satisfactory one searching online.

If I have a 25kb page (html) that displays a 75kb image, does that amount to 100k of data transferred from my web server/host to the user? Does it make any difference or does that 75k only "count" if the user actually downloads the image from the server? We're trying to compute resources needed for an image hosting service but the difference between 100k and 25k is obviously a significant one.

已采纳解答

原帖链接 · Trebor · CC BY-SA 4.0

It's not possible to view an image in a web page without downloading it. Your browser downloads every image to a local cache folder for every image you view in your browser. So, in answer to your question, you will always be downloading 100kb.

Now, if your goal is to offload your image downloads from your server, you should consider a Content Delivery Network or CDN. A CDN is a distributed network of servers optimized for hosting your images and other static files like your JavaScript and CSS.

When a client browser views your page, the browser downloads this image from the CDN, instead of your web server.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2020-09-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。