如何在网站上更快地加载图像 [英] How to load image faster in website

查看:74
本文介绍了如何在网站上更快地加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站包含大量图片,有更多时间加载页面。所以你能建议我加载更快。

My webiste contains lot of images getting more time to load the page.so can you suggest me any way load faster .

推荐答案

这个问题没什么意义。由于您没有编写加载图像的代码,因此您无需优化。图像由客户端(浏览器)下载,而不是ASP.NET代码。你没有提到飞行中的图像创建,所以我可以假设这些是静态图像。如果图像显示在您的网页上,您甚至不会阅读它们并发送HTTP响应。相反,HTTP响应仅包含文件名。当页面在客户端呈现时,浏览器发送额外的HTTP请求以获取图像。此时,您的ASP.NET页面工作周期已经结束。图像将从文件中读取,并由HTTP浏览器本身发送到客户端。同样,你的ASP.NET代码都没有参与这个过程。



没有什么可以优化的。



-SA
The question makes little sense. As you are not writing the code which loads the images, you have nothing to optimize. The images are downloaded by the client side, a browser, not your ASP.NET code. You did not mention creation of images in the fly, so I can assume those are static images. If the images are shown on your Web page, you don't even read them and send in your HTTP response. Instead, HTTP response contains only the file names. When the page is rendered on the client side, the browser sends additional HTTP request to get the images. At this moment, your ASP.NET page work cycle is already over. The images will be read from a file and send to the client side by the HTTP browser itself. Again, none of your ASP.NET code participates in this process.

There is nothing to optimize.

—SA


您好,如果您的页面有很多图片,并且您将它们保存在服务器上,您可以尝试将它们放在一张大图中。这种技术称为图像精灵。



这里有一个如何使用它的链接:



http: //www.tutorialrepublic.com/css-tutorial/css-sprites.php



如果您从不同的服务器(从互联网)下载图像,这可能是一个好主意将它们全部下载到您的服务器上。



也许尝试向我们展示您的网页,以便我们可以看到您的页面上发生了什么?



希望它有用
Hello if your page has lot of images and you keep them on your server, you can try to put them into one big picture. This technique is called image sprite.

here is a link how to use it:

http://www.tutorialrepublic.com/css-tutorial/css-sprites.php

If you download images from different servers(from internet) it might be a good idea to download them all on your server.

Maybe try to show us your web page so we could see what is going on your page?

Hope it is helpful


这篇关于如何在网站上更快地加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆