雅虎前端优化策略

2022-09-14 10:27:29 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

  • Content ·「网页内容相关
    • Make Fewer HTTP Requests [减少http请求次数]
    • Reduce DNS Lookups [减少DNS查询次数]
    • Avoid Redirects [避免页面跳转]
    • Make Ajax Cacheable [缓存Ajax]
    • Postload Components [延迟加载]
    • Preload Components [提前加载]
    • Reduce the Number of DOM Elements [减少Dom元素数量]
    • Split Components Across Domains [根据域名划分内容]
    • Minimize Number of iframes [减少iframes数量]
    • Avoid 404s [避免404]
  • Server ·「服务器相关
    • Use a Content Delivery Network (CDN) [使用CDN]
    • Add Expires or Cache-Control Header ×[添加Cache-Control控制头]
    • Gzip Components [压缩传输文件]
    • Configure ETags [配置ETags]
    • Flush Buffer Early [尽早flush输出]
    • Use GET for Ajax Requests [使用get请求]
    • Avoid Empty Image src             [避免空的图片src]
  • Cookie ·「缓存
    • Reduce Cookie Size [减少Cookie大小]
    • Use Cookie-Free Domains for Components [页面内容使用无cookie域名]
  • CSS ·「CSS
    • Put Stylesheets at Top [样式置顶]
    • Avoid CSS Expressions [避免CSS表达式]
    • Choose Over @import [选择link而不是import]
    • Avoid Filters [避免使用Filters]
  • JavaScript ·「JavaScript
    • Put Scripts at Bottom [脚本置底]
    • Make JavaScript and CSS External [使用外部的JavaScript和CSS3]
    • Minify JavaScript and CSS [简化的Js和css]
    • Remove Duplicate Scripts [脚本去重]
    • Minimize DOM Access [减少Dom访问]
    • Develop Smart Event Handlers [使用智能事件处理]
  • Images ·「图片
    • Optimize Images [优化图片]
    • Optimize CSS Sprites [优化雪碧图]
    • Do Not Scale Images in HTML [不要在html中缩放图片]
    • Make favicon.ico Small and Cacheable [使用小且可缓存的favicon.ico]
  • Mobile ·「移动客户端
    • Keep Components Under 25 KB [保持单个内容小于25KB]
    • Pack Components Into a Multipart Document [打包组建成复合文档]

https://developer.yahoo.com/performance/rules.html

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/158478.html原文链接:https://javaforall.cn

0 人点赞