Minimize HTTP Requests
来源:互联网 发布:淘宝网店发货流程 编辑:程序博客网 时间:2024/06/05 13:35
80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages.
One way to reduce the number of components in the page is to simplify the page's design. But is there a way to build pages with richer content while also achieving fast response times? Here are some techniques for reducing the number of HTTP requests, while still supporting rich page designs.
Combined files are a way to reduce the number of HTTP requests by combining all scripts into a single script, and similarly combining all CSS into a single stylesheet. Combining files is more challenging when the scripts and stylesheets vary from page to page, but making this part of your release process improves response times.
CSS Sprites are the preferred method for reducing the number of image requests. Combine your background images into a single image and use the CSS background-image and background-position properties to display the desired image segment.
Image maps combine multiple images into a single image. The overall size is about the same, but reducing the number of HTTP requests speeds up the page. Image maps only work if the images are contiguous in the page, such as a navigation bar. Defining the coordinates of image maps can be tedious and error prone. Using image maps for navigation is not accessible too, so it's not recommended.
Inline images use the data: URL scheme to embed the image data in the actual page. This can increase the size of your HTML document. Combining inline images into your (cached) stylesheets is a way to reduce HTTP requests and avoid increasing the size of your pages. Inline images are not yet supported across all major browsers.
Reducing the number of HTTP requests in your page is the place to start. This is the most important guideline for improving performance for first time visitors. As described in Tenni Theurer's blog post Browser Cache Usage - Exposed!, 40-60% of daily visitors to your site come in with an empty cache. Making your page fast for these first time visitors is key to a better user experience.
One way to reduce the number of components in the page is to simplify the page's design. But is there a way to build pages with richer content while also achieving fast response times? Here are some techniques for reducing the number of HTTP requests, while still supporting rich page designs.
Combined files are a way to reduce the number of HTTP requests by combining all scripts into a single script, and similarly combining all CSS into a single stylesheet. Combining files is more challenging when the scripts and stylesheets vary from page to page, but making this part of your release process improves response times.
CSS Sprites are the preferred method for reducing the number of image requests. Combine your background images into a single image and use the CSS background-image and background-position properties to display the desired image segment.
Image maps combine multiple images into a single image. The overall size is about the same, but reducing the number of HTTP requests speeds up the page. Image maps only work if the images are contiguous in the page, such as a navigation bar. Defining the coordinates of image maps can be tedious and error prone. Using image maps for navigation is not accessible too, so it's not recommended.
Inline images use the data: URL scheme to embed the image data in the actual page. This can increase the size of your HTML document. Combining inline images into your (cached) stylesheets is a way to reduce HTTP requests and avoid increasing the size of your pages. Inline images are not yet supported across all major browsers.
Reducing the number of HTTP requests in your page is the place to start. This is the most important guideline for improving performance for first time visitors. As described in Tenni Theurer's blog post Browser Cache Usage - Exposed!, 40-60% of daily visitors to your site come in with an empty cache. Making your page fast for these first time visitors is key to a better user experience.
- Minimize HTTP Requests
- Requests: HTTP for Humans
- Requests: HTTP for Humans
- Http Requests for PHP
- Requests之HTTP基本原理
- python http客户端(requests)
- Requests Header | Http Header
- python requests请求http
- UNDERSTANDING HTTP REQUESTS AND RESPONSES
- Requests:让 HTTP 服务人类
- Requests: 让 HTTP 服务人类
- Requests: 让 HTTP 服务人类
- Python HTTP库requests 介绍
- Python requests实现HTTP请求
- Requests: 让 HTTP 服务人类
- Requests: 让 HTTP 服务人类
- python http请求工具Requests
- Changing the headers for UIWebKit HTTP requests
- Javascript调用后台方法
- python集锦(四)
- Remove Duplicate Scripts .
- Android给自定义控件添加自定义属性
- Asp.Net MVC 3.0【MVC项目实战の四】
- Minimize HTTP Requests
- Linux中运行的进程:ps/top
- sysfaces.exe-explorer应用程序错误
- Asp.Net MVC3.0【MVC项目实战の五】
- Use a Content Delivery Network .
- ifconfig详解
- RBF Gauss Kernel
- 域名DNS轮循解析
- 很好的IOS开发界面元素设计网站