教你50招提升ASP.NET性能(十三):精选技巧集合

本文提供了一系列优化网页性能的实用技巧,包括在<img/>标签中加入height和width属性以加速页面呈现,将脚本引用放置在页面底部以实现异步下载,使用CDN托管图像和脚本以减轻服务器负载,以及使用图像精灵、AJAX、HTTP模块移除、CDN等技术进一步提升加载速度。

(19)A selection of tips

招数19:

精选技巧集合

Including height and width in <img /> tags will allow your page to render more quickly, because space can be allocated for the image before it is downloaded.
在<img />标签中包括height和width属性会加速你的页面呈现,因为下载完成之前空间可以分配给图像。

 

(20)Add script references at the bottom of the page, because asynchronous downloads halt when a script reference is reached. Style sheets and images can be downloaded
asynchronously.

招数20:

在页面底部添加脚本引用,因为当脚本引用到达时异步下载中断。样式表和图像是能够异步下载。

 

(21)Use a content delivery network (CDN) for hosting images and scripts. They may be cached and it will reduce load on your server.

招数21:

使用内容分发网络(CDN)托管图像和脚本。它可能会被缓存从而减少你服务器的负载。

 

(22)Use image sprites to retrieve smaller images in one download.

招数22:

使用图像精灵通过一次下载获取小的图像。

 

(23)Use AJAX to retrieve components asynchronously that may not be needed immediately, such as the content of a collapsed panel, content behind a tab, and so on.

招数23:

使用AJAX异步获取可能不需要立即加载的组件,比如伸缩面板的内容,TAB页后面的内容,等等。

 

(24)Make sure you’ve removed HTTP modules that aren’t being used (Windows authentication, for example), and that you’ve disabled services such as FTP and SMTP, if
you’re not using them.

招数24:

如果你不使用它,确保你已经移除了不使用的HTTP模块(比如,Windows认证),和禁用了FTP和SMTP服务。

转载于:https://www.cnblogs.com/JavCof/p/3200804.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值