Visit Shenzhen, Shenzhen China, Shenzhen Travel Guide

Shenzhen Universiade - Shenzhen 2011 Summer Universiade

导航

Web开发中的性能:谈Google和Facebook的网站使用到的技术,图片预加载CSS Sprites

(January 11) http://www.handandaily.com

首先我要说的是博客园的速度打开的很慢,深圳南山的

如果你知道这种技术,那就不用进来了,

1.首先你先打开下面两个连接:(下面链接不是一般的图片,无毒无广告)


http://static.ak.facebook.com/images/sprite/icons.png?db3
http://www.google.com/images/nav_logo3.png

刚才在Google搜索的首页,发现在bodyonload里有这么一句:

if(document.images){new Image().src='/images/nav_logo3.png'}

那么来看看这个http://www.google.com/images/nav_logo3.png是个啥?

就是它:

Google.com's CSS Sprite



Css Sprites,就是将页面中所有css装饰图合并成一个较大的图,然后用到特定的css装饰图的时候就利用css的background-image:大图,background-position:小图在大图中的x位置,小图在大图中的y位置


优点:利用Css Sprites可以提升网站的性能,普通制作方式下的大量图片,现在合并成一个图片,大大减少了HTTP的连接数。HTTP连接数对网站的加载性能有重要影响。

按照yahoo的 rules for high performance web sites的原则,应当较少Client与Server端间的HTTP Request次数。

通过CSS Sprites方法将多张图片组装成单独的一张图片,可以有效减少HTTP请求的次数。




关于更多的CSS Sprites
http://www.handandaily.com/post/cat_8.html
  • Murdoch: China, India will reshape the world
  • Telefonica O2 CR contracts Huawei for 3G expansion
  • Huawei ‘to make $2bn in Africa’
  • Huawei seals 3G network deal in Czech
  • Uganda Telecom signed an agreement Thursday with Huawei Technologies to expand its existing Next Generation Network
  • Huawei’s Ever-Expansion Strategy May Hit a Wall, or Not
  • Huawei industry firsts usher in converged ultra broadband era for operators
  • Huawei to expand Uganda telecom’s next generation network
  • Obama’s remarks on China are rhetoric, some say
  • Chinese Regulators Destroy Tons of Tainted Animal Feed
  • China landslide leaves 20 dead, 42 missing
  • Guangzhou:Hotels and Fights Hard to Survive in the Financial Crisis
  • Guangzhou:New Bus/Metro IC Card Put in Use Today
  • Guangzhou:Bird Repays Master by Eating Mosquitoes
  • Huawei pioneer in launching Professional Service Center in Jordan
  • Guangzhou Officially Acclaimed As a “National Garden City”
  • Guaungzhou to Upgrade Neighborhood Environments of Asian Games Venues
  • 500 Million US Dollars Signed between Guangzhou and Europe
  • Guangzhou:Map Shows Fancy Restaurants in Xiguan
  • SKYWORTH Guangzhou Industrial Base Goes Into Production
  • Guangzhou to Improve Management of Professional Markets
  • Convention & Exhibition Industry in Guangzhou Draws International Attention
  • Guangzhou:Over 130,000 Customers Visited in 4-days’ Yangcheng Book Exhibition
  • Guangzhou:Museum to Represent Island Life of Six Centuries Ago
  • Guangzhou:Country Life Attracts Urban Residents
  • Guangzhou:Guangzhong Allies with Russian Ural Heavy Machinery Factory
  • Guangzhou Holds Investment Cooperation Exchange in Germany
  • Second Session of 104th Canton Fair Sealed Export Deals of USD 8.31 Billion
  • Guangzhou:Cases to Go Public through Internet
  • Cantonese Opera Exhibition Hall Would Be Built in Liwan,Guangzhou
  • Ban on Liquid not Removed at Guangzhou Baiyun International Airport
  • Guangzhou:Shiling Leather Industry Gets Boost
  • Guangzhou Gang of Airborne Thieves Arrested on Touch Down
  • Guangzhou Zengcheng Chosen as one of “National Top 10 Ecological Leisure Bases”
  • Guangzhou Police Employs 47 Police Supervisors against Corruption
  • Chigang Tower Park to Become A Memorial Park in guangzhou
  • One-hour Travel throughout Guangzhou by 2020
  • Guangzhou:Family Friend Accused of Raping 21-month-old
  • Shenzhen University:International Teachers Wanted
  • China’s Canton Fair suffers drop in attendance
  • Hello Everyone. Needed some friends in Guangzhou.
  • Guangzhou Toyota keeps 210,000-unit sales goal
  • Guangzhou furniture show draws 36,34
  • BPA to present at HKPCA show in Shenzhen
  • Zhuhai plans Asia’s largest pilot training facility
  • China: Brazil’s Embraer present at Airshow China 2008, in Zhuhai
  • Bombardier Lands at Airshow China 2008, Zhuhai
  • China:Six dead in worst Tibet snowstorm on record, 1,700 others stranded
  • China-Britain Business Council CBBC Shenzhen
  • UK Trade and Investment In Guangzhou
  • posted on 2007-10-25 14:11  haix  阅读(1864)  评论(13编辑  收藏  举报

    Shenzhen Universiade - Shenzhen 2011 Summer Universiade