Upgrade to Pro — share decks privately, control downloads, hide ads and more …

跨越不可能-让WebApp如Native般顺滑

 跨越不可能-让WebApp如Native般顺滑

time zhong

June 12, 2014
Tweet

More Decks by time zhong

Other Decks in Technology

Transcript

  1. ` TimeZhong ! ! ! ! ! ! ! 仲⾦金⻰龙

    社交平台设计中⼼心 QQ空间 ! Id: ⻨麦时 Wehat: timezhong
  2. `

  3. The basics • Async everything: defer and async on script

    tags ! • Even async scripts can block the load event:Start loading your scripts after onload ! • Reduce HTTP requests with spriting and script concatenation
  4. Prefetch and friends 1. Pre-resolve DNS hostnames for assets later

    in the page: <link rel='dns-prefetch' href=‘hostname-to-resolve.com'> ! 2. Fetch subresources early so they're already there when needed: <link rel='subresource' href=‘/path/to/some/script.js'> ! 3.Pre-fetch resources for likely future navgiations: <link rel='prefetch' href=‘/most/likely/next/page.html'> ! 4.Pre-render an entire page in the background (Chrome only) <link rel='prerender' href='/overwhelmingly/likely/next/page.html'>
  5. 带来的问题 带来的问题 • 标准对话框⽆无效 (iOS 7.0.3 solved) • ⽆无法打开外部链接 (iOS

    7.0.3 solved) • 安装超过4个后出现奇怪问题 • Application Cache异常 • Cookie ⽆无效
  6. • Providing feedback makes it seem faster. Think about psycology

    • Overestimating the time remaining makes it seem to finish quicker • Progress feedback that starts sooner finishes sooner • Good analogy with the 'close evelator doors' button, it likely doesn't do anything, but people like it because it makes them feel part of the process, partial control