1、应该将 CSS 放置于结构的上方(一般放置于 head 元素内)。CSS 是解释型语言,Firefox 和 IE 在等待 CSS 传输完成之前不会渲染任何东西。只有将 CSS 前置,才可在浏览器解析结构时,对页面进行渲染。
This causes the blank white screen problem. The page is totally blank until the stylesheet at the bottom is downloaded, on the order of 6-10 seconds for this page. The browser is waiting for the stylesheet to be loaded before it renders anything [...]
...
20 条评论 »
2008-3-25 下午 - 网站优化 - CSS
最近 Yahoo! Exceptional Performance 在 《优化网站性能的 14 条规则》的基础上又增加了 20 条新的规则。
1. 尽早清除缓冲区
[server]
2. AJAX 请求使用“GET”方法
[server]
3. 延迟加载组件
[content]
4. 预加载组件
[content]
5. 减少 DOM 元素的数量
[content]
6. 跨域分离组件
[content]
7. 减少 iframes 的数量
[content]
8. 不出现 404
[content]
9. 减小 cookie 的体积
[cookie]
10. 为组件使用 cookie-free 的域名
[cookie]
11.减少访问 DOM 的次数
[javascript]
12. 开发巧妙的事件处理程序
[javascript]
13. 优先选择使用 <link> 而非 @import
[css]
14. 避免使用 filters
[css]
15. 优化图片
[images]
16. 优化 CSS sprites
[images]
17. 不要在 HTML 中缩放图片
[images... 5 条评论 »
2008-3-23 下午 - 网站优化 - Yahoo
优化网站性能的14条规则(更新)
1. 尽可能的减少 HTTP 的请求数
[content]
2. 使用 CDN(Content Delivery Network)
[server]
3. 添加 Expires 头(或者 Cache-control )
[server]
4. Gzip 组件
[server]
5. 将 CSS 样式放在页面的上方
[css]
6. 将脚本移动到底部(包括内联的)
[javascript]
7. 避免使用 CSS 中的 Expressions
[css]
8. 将 JavaScript 和 CSS 独立成外部文件
[javascript] [css]
9. 减少 DNS 查询
[content]
10. 压缩 JavaScript 和 CSS (包括内联的)
[javascript] [css]
11. 避免重定向
[server]
12. 移除重复的脚本
[javascript]
13. 配置实体标签(ETags)
[css]
14. 使 AJAX 缓存
[content]
详细请看:Best Practices for Speeding Up [...]
...
13 条评论 »
2008-3-22 下午 - 网站优化 - 优化
今天 承志 看到的,感觉比较有收获,分享一下:
When generating hyperlinks, always include a trailing slash if possible. For instance, navigating to http://msdn.microsoft.com/ie takes one more roundtrip than http://msdn.microsoft.com/ie/. When the browser navigates to the /ie url, the server merely sends down a 301 to the /ie/ url. Both links work, but the second version is faster.
也就是说,在地址栏中发送 URL:http://msdn.microsoft.com/ie ,服务器将会产生一个 301 转向至 [...]
...
12 条评论 »
2008-3-18 下午 - 网站优化 - URL - 优化