1: Minimize HTTP Requests
Quote:
http://developer.yahoo.com/performance/rules.html#num_http
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.
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.
CSS Sprites are the preferred method for reducing the number of image requests. Combine all the images in your page into a single image and use the CSS background-image and background-position properties to display the desired image segment.
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.
Combined files are a way to reduce the number of HTTP requests by combining all scripts into a single script, and similarly combining all stylesheets into a single stylesheet. It's a simple idea that hasn't seen wide adoption. The ten top U.S. web sites average 7 scripts and 2 stylesheets per page. 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.
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
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.
分享到:
相关推荐
原书最新第5版 Need help finding the right ...If you’re an experienced web designer or developer who needs a quick resource for working with established web standards, this handy book is indispensable.
Publisher: O'Reilly Media ...If you’re an experienced web designer or developer who needs a quick resource for working with established web standards, this handy book is indispensable.
quality code for their asynchronous tasks by building a relatively simple application that will use advanced RxJava techniques to produce a high quality product. First of all, the book will lead a ...
Project catch-up: An educational program for socially disadvantaged thirteen and fourteen year olds PROJECT CATCH-UP: AN EDUCATIONAL PROGRAM FOR SOCIALLY DISADVANTAGED THIRTEEN AND FOURTEEN YEAR ...
这篇文档是关于外研版小学英语三年级下册Module 4 Unit 2的教案,主题是教授数字13至19的英语表达,包括thirteen, fourteen, fifteen等,并且着重训练学生如何用英语询问和回答数量,即"How many... are there? ...
known as the MUST method, after a Danish acronym for theories and methods of initial analysis and design activities – was developed and tested in thirteen industrial design projects for companies and...
Publisher : Addison Wesley... A technique for building debugging support into your software without a ton of overhead Thirteen specific techniques to improve the overall performance of your software
这篇文档是针对外研社小学英语六年级下册第一模块第一单元"I want a hot dog, please"的内容设计的一套综合练习题,旨在帮助学生巩固与快餐相关的基本词汇和日常交流用语。 一、翻译单词和短语: 1. 汉堡 - ...
Thirteen 0 clock
Netflix gauged the show's potential from data it had gathered about subscribers' preferences, ordered two seasons without seeing a pilot, and uploaded the first thirteen episodes all at once for ...
标题“Riverdale_1x13_HDTV.SVA+AVS.fr_TheRules_yellowock_wind_”中的关键词“Riverdale”表明这是一个与电视剧《Riverdale》相关的内容,而“1x13”指的是该电视剧的第一季第十三集。通常,这种格式的文件名是...
【标题】:“小贝程序员生活\课件\java\javaclass\thirteen lesson.rar” 提供的是一份关于Java编程的课程资料,其中包含了第十三课的内容。这个压缩包很可能是针对初学者或者有一定基础的Java开发者设计的,旨在...
- 回答年龄时,用"基数词 + year(s) old",例如:"I’m thirteen."(我十三岁了)。 **学以致用** - 例题:"—____?" 应该填入"How old are you",因为是询问年龄,答案是C。 - 句子:"Jane is ____ old." 正确...
标题中的"Thirteen:初始构建"表明我们正在讨论一个名为"Thirteen"的项目,它是一个基于纸牌游戏"十三"的开发初期阶段。在这个阶段,开发者通常会进行项目的架构设计、基本功能实现以及必要的配置设置。由于标签是...
Water surface slope is a significant component to many equations for modeling hydraulics, sediment transport, and fluvial geomorphic processes (Knighton, 1999, Sing & Zang, in press). Traditional ...
- **Preparation for the lesson**(课前预习):通过翻译单词来复习词汇,例如坐下(sit),起立(stand up),打开你的书(open your book),举起你的手(put up your hand),学生(student),女孩(girl),...