SlideShare a Scribd company logo
1
Summary
•    High Performance Infrastructure
•    High Compatibility UI Pattern
•    YSlow & Mobile Web Best Practices
•    What’s Special on iPad?




                                         2
Traffic



                       Load Balancer




    Web Server      Web Server      Web Server       Web Server

                         Server Farm (VM)




Distributed Cache                                Application Server
   Server Farm                                          Farm




                                                                      3
MVC in JS at Client Browser
 Controller – Script#         View - jTemplate


           Model – Restful Service




               ASP.NET MVC 2




                                                 4
YSlow & Mobile Web Best Practices
•    http://developer.yahoo.com/performance/rules.html
•    http://www.w3.org/TR/mwabp/



               Mini*                  More
              Requests                Cache

                                   Optimized
                 Less
                                    HTML &
                Cookie
                                     CSS


                                                         5
Mini* Requests
  40-60% of visitors come in with an empty cache.
             •  CSS Sprites
             •  Merge CSS & JS
             •  Pre-load/Post-load
  Minimize

             •  Minify CSS & JS
             •  Gzip
             •  JSON vs XML
   Minify    •  Optimize image dimension and quality




                                                       6
Cache
80-90% of response time is for downloading resources.
 Version and never expire static
 resources

 Set cache-control header for
 cacheable dynamic resources

 Use CDN


                                                        7
Cookie
  Every request (even static resource) carries the
  active cookie data at the same domain.

            Eliminate unnecessary cookies


         Set cookie at minimal domain level


                  Expire cookie ASAP


                  Minimize cookie size


                                                     8
Optimize HTML & CSS

     W3C          Scripts at
   Validation      Bottom


                   Avoid
   External
                   Empty
   CSS & JS
                 Image src

                               9
What’s Special on iPad?
                 New         Cache                   Instable
 New Events                             Slower CPU
              Dimensions   Limitation                Network


                            255K -
                                          Slower
                           cacheable
    Tap        Viewport                   HTML
                            request                  Connection
                                          Engine
                              size                      Lost

                                          Slower
                            1.5M - in
   Touch         Scale                     CSS
                            Memory
                                          Engine

                                                       Speed
                            5~25M -      Slower JS    Variable
    Pinch       Rotation
                             Offline      Engine




                                                                  10
Map Touch Events to Mouse Events

         Touch     Mouse
         Start     Down

         Touch     Mouse
         Move      Move

         Touch     Mouse
          End       Up

                                   11
Tap Is Not Mouse Click

     Mouse      Mouse    Mouse
     Click      Down      Up

      Tap
                Touch    Touch
                Start     End

    Optimized   Touch
       Tap      Start


                                 12
UIWebView Is Not Safari

 Rotation not Work


 Could not Disable Offline Cache


 Stricter HTML Parser


                                   13
1.5M In-memory Cache Is Useless




    255K (15K      Never
    in iPhone)    Persisted




                                  14
Offline Cache Optimization
   UI for downloading & updateready

   AJAX for Pre-load and Post-load

   Big CSS Sprite

   Dynamically Load JS & CSS

  Inline Base64 Image Binary in HTML, CSS &
  JS

                                              15
Optimize JS Performance

   Avoid Long JS Execution


   Use Asynchronous AJAX


   Use window.setTimeout


                             16
Video and Audio Streaming




   Automatically switch among   different bitrates


                                                     17
Native App Work with UIWebView

  Access Local Resources, e.g. Microphone


  Detect & Notify Connection Lost


  Move Heavy Computing to Native C/C++


  Behave Like Native App


  Release Web App is Cheaper


                                            18
Page Communicate with Native App




   Periodically             Custom
                  Rather
     Eval JS               Address in
                   than
    from App                 Page




                                        19
Summary
•    High Performance Infrastructure
     o  Cloud
•    High Compatibility UI Pattern
     o  MVC
•    YSlow & Mobile Web Best Practices
     o    Mini* Requests
     o    More Cache
     o    Less Cookie
     o    Optimized HTML & CSS
•    What’s Special on iPad?
     o    New Events
     o    New Dimensions
     o    Cache Limitation
     o    Slower CPU
     o    Instable Network

                                         20
Everything Is Trade-off
Even for Most Ideal Cases
-- Steven Souders




                            21
Further Reading
•    High Performance Web Sites: Essential Knowledge for
     Front-End Engineers
•    Even Faster Web Sites: Performance Best Practices for
     Web Developers




                                                        22
23
Thanks
      &
Happy New Year
     2011


                 24

More Related Content

PDF
Speed Matters
PDF
PAC 2019 virtual Mark Tomlinson
PPTX
Sneak Preview Of Vignette V8
PDF
WebAssembly vs JavaScript: What is faster?
PDF
ASP.NET Scalability - DDD7
PDF
How MongoDB is Being Used in China - Case Studies
PPTX
Javascript for Wep Apps
PPTX
Billing system using node Presentation
Speed Matters
PAC 2019 virtual Mark Tomlinson
Sneak Preview Of Vignette V8
WebAssembly vs JavaScript: What is faster?
ASP.NET Scalability - DDD7
How MongoDB is Being Used in China - Case Studies
Javascript for Wep Apps
Billing system using node Presentation

What's hot (18)

PPTX
Hyper-V Dynamic Memory in Depth
PPTX
Mobile gotcha
PDF
WordPress Optimization with Litespeed Cache #wpjkt14
PPTX
How hard can it be
KEY
LinkedIn Mobile: How do we do it?
PDF
Architecting for scalability in cf
PPTX
How to develop innovative, scalable systems
PPTX
Orlando DNN Usergroup Pres 12/06/11
PDF
High Performance Web Applications in the Cloud
KEY
Mongo Seattle - The Business of MongoDB
PPTX
High performance java ee with j cache and cdi
PDF
Deploying and Scaling using AWS
PPTX
ApacheCon North America - Introduction to FlexJS
KEY
Sinatra and Heroku - A comfortable ruby way for web service
PPTX
Performance tuning in hybrid mobile apps
PPTX
JavaEE Microservices platforms
PPTX
Lap Around: Windows Azure and Kentico CMS 6
PPTX
Introduction to headless browsers
Hyper-V Dynamic Memory in Depth
Mobile gotcha
WordPress Optimization with Litespeed Cache #wpjkt14
How hard can it be
LinkedIn Mobile: How do we do it?
Architecting for scalability in cf
How to develop innovative, scalable systems
Orlando DNN Usergroup Pres 12/06/11
High Performance Web Applications in the Cloud
Mongo Seattle - The Business of MongoDB
High performance java ee with j cache and cdi
Deploying and Scaling using AWS
ApacheCon North America - Introduction to FlexJS
Sinatra and Heroku - A comfortable ruby way for web service
Performance tuning in hybrid mobile apps
JavaEE Microservices platforms
Lap Around: Windows Azure and Kentico CMS 6
Introduction to headless browsers

Viewers also liked (9)

PPTX
Cookies testing
PDF
Firefox Cookies and Cache Instructions
PPT
Electronic computer cookies
PPTX
Cookie testing
PDF
Cookies and browser exploits
PPTX
Encryption
PPT
Presentation on Internet Cookies
ODP
Encryption presentation final
PDF
SaaS Testing Overview - Foundation
Cookies testing
Firefox Cookies and Cache Instructions
Electronic computer cookies
Cookie testing
Cookies and browser exploits
Encryption
Presentation on Internet Cookies
Encryption presentation final
SaaS Testing Overview - Foundation

Similar to 针对iPad平台的高性能网站架构 (20)

PDF
Developer Pitfalls & Strategies for Improving Mobile Web Developer Experience
PDF
The Modern Web, Part 1: Mobility
KEY
W3C Mobile Web technologies
PPTX
How To Be an HTML5 Mobile Cloud Champion
PPTX
Creating Mobile Websites with Kentico CMS 7
PDF
Everything You Know is Not Quite Right Anymore: Rethinking Best Web Practices...
PDF
Everything You Know is Not Quite Right Anymore: Rethinking Best Practices to ...
PPTX
Web Performance 101
PPTX
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
PPTX
High Performance Mobile Web
PDF
Building Cloud-Based Cross-Platform Mobile Web Apps
PDF
Mobile App Development
PDF
Ideas for addictive series 40 web apps
PDF
High Performance Websites
KEY
Building Faster Websites
KEY
Faster Frontends
PDF
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
PPTX
Top Tips to Deliver Quality Web Experiences From IE 9 to the iPhone
PDF
Hybrid Apps / iPhoneDevCon 2010
PPTX
Kentico Technical Learning: Exploring jQuery Mobile
Developer Pitfalls & Strategies for Improving Mobile Web Developer Experience
The Modern Web, Part 1: Mobility
W3C Mobile Web technologies
How To Be an HTML5 Mobile Cloud Champion
Creating Mobile Websites with Kentico CMS 7
Everything You Know is Not Quite Right Anymore: Rethinking Best Web Practices...
Everything You Know is Not Quite Right Anymore: Rethinking Best Practices to ...
Web Performance 101
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
High Performance Mobile Web
Building Cloud-Based Cross-Platform Mobile Web Apps
Mobile App Development
Ideas for addictive series 40 web apps
High Performance Websites
Building Faster Websites
Faster Frontends
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
Top Tips to Deliver Quality Web Experiences From IE 9 to the iPhone
Hybrid Apps / iPhoneDevCon 2010
Kentico Technical Learning: Exploring jQuery Mobile

More from jeffz (20)

PDF
Wind.js无障碍调试与排错
PDF
JavaScript现代化排错实践
PDF
Jscex:案例、阻碍、体会、展望
PDF
Jscex:案例、经验、阻碍、展望
PDF
The Evolution of Async Programming (GZ TechParty C#)
PDF
深入浅出Jscex
PDF
Mono for .NET Developers
PDF
Javascript Uncommon Programming
PDF
Jscex: Write Sexy JavaScript (中文)
PDF
Jscex: Write Sexy JavaScript
PDF
单点登录解决方案的架构与实现
PDF
Documentation Insight技术架构与开发历程
PDF
Windows Phone应用开发心得
PDF
分布式版本管理
PDF
使用.NET构建轻量级分布式框架
PDF
企业开发领域的语言特性
PDF
The Evolution of Async-Programming on .NET Platform (TUP, Full)
PDF
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
PDF
The Evolution of Async-Programming (SD 2.0, JavaScript)
PDF
大话程序员可用的算法
Wind.js无障碍调试与排错
JavaScript现代化排错实践
Jscex:案例、阻碍、体会、展望
Jscex:案例、经验、阻碍、展望
The Evolution of Async Programming (GZ TechParty C#)
深入浅出Jscex
Mono for .NET Developers
Javascript Uncommon Programming
Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript
单点登录解决方案的架构与实现
Documentation Insight技术架构与开发历程
Windows Phone应用开发心得
分布式版本管理
使用.NET构建轻量级分布式框架
企业开发领域的语言特性
The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming (SD 2.0, JavaScript)
大话程序员可用的算法

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
A Presentation on Artificial Intelligence
PDF
Modernizing your data center with Dell and AMD
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
Teaching material agriculture food technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Review of recent advances in non-invasive hemoglobin estimation
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
A Presentation on Artificial Intelligence
Modernizing your data center with Dell and AMD
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Reach Out and Touch Someone: Haptics and Empathic Computing
Teaching material agriculture food technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

针对iPad平台的高性能网站架构

  • 1. 1
  • 2. Summary •  High Performance Infrastructure •  High Compatibility UI Pattern •  YSlow & Mobile Web Best Practices •  What’s Special on iPad? 2
  • 3. Traffic Load Balancer Web Server Web Server Web Server Web Server Server Farm (VM) Distributed Cache Application Server Server Farm Farm 3
  • 4. MVC in JS at Client Browser Controller – Script# View - jTemplate Model – Restful Service ASP.NET MVC 2 4
  • 5. YSlow & Mobile Web Best Practices •  http://developer.yahoo.com/performance/rules.html •  http://www.w3.org/TR/mwabp/ Mini* More Requests Cache Optimized Less HTML & Cookie CSS 5
  • 6. Mini* Requests 40-60% of visitors come in with an empty cache. •  CSS Sprites •  Merge CSS & JS •  Pre-load/Post-load Minimize •  Minify CSS & JS •  Gzip •  JSON vs XML Minify •  Optimize image dimension and quality 6
  • 7. Cache 80-90% of response time is for downloading resources. Version and never expire static resources Set cache-control header for cacheable dynamic resources Use CDN 7
  • 8. Cookie Every request (even static resource) carries the active cookie data at the same domain. Eliminate unnecessary cookies Set cookie at minimal domain level Expire cookie ASAP Minimize cookie size 8
  • 9. Optimize HTML & CSS W3C Scripts at Validation Bottom Avoid External Empty CSS & JS Image src 9
  • 10. What’s Special on iPad? New Cache Instable New Events Slower CPU Dimensions Limitation Network 255K - Slower cacheable Tap Viewport HTML request Connection Engine size Lost Slower 1.5M - in Touch Scale CSS Memory Engine Speed 5~25M - Slower JS Variable Pinch Rotation Offline Engine 10
  • 11. Map Touch Events to Mouse Events Touch Mouse Start Down Touch Mouse Move Move Touch Mouse End Up 11
  • 12. Tap Is Not Mouse Click Mouse Mouse Mouse Click Down Up Tap Touch Touch Start End Optimized Touch Tap Start 12
  • 13. UIWebView Is Not Safari Rotation not Work Could not Disable Offline Cache Stricter HTML Parser 13
  • 14. 1.5M In-memory Cache Is Useless 255K (15K Never in iPhone) Persisted 14
  • 15. Offline Cache Optimization UI for downloading & updateready AJAX for Pre-load and Post-load Big CSS Sprite Dynamically Load JS & CSS Inline Base64 Image Binary in HTML, CSS & JS 15
  • 16. Optimize JS Performance Avoid Long JS Execution Use Asynchronous AJAX Use window.setTimeout 16
  • 17. Video and Audio Streaming Automatically switch among different bitrates 17
  • 18. Native App Work with UIWebView Access Local Resources, e.g. Microphone Detect & Notify Connection Lost Move Heavy Computing to Native C/C++ Behave Like Native App Release Web App is Cheaper 18
  • 19. Page Communicate with Native App Periodically Custom Rather Eval JS Address in than from App Page 19
  • 20. Summary •  High Performance Infrastructure o  Cloud •  High Compatibility UI Pattern o  MVC •  YSlow & Mobile Web Best Practices o  Mini* Requests o  More Cache o  Less Cookie o  Optimized HTML & CSS •  What’s Special on iPad? o  New Events o  New Dimensions o  Cache Limitation o  Slower CPU o  Instable Network 20
  • 21. Everything Is Trade-off Even for Most Ideal Cases -- Steven Souders 21
  • 22. Further Reading •  High Performance Web Sites: Essential Knowledge for Front-End Engineers •  Even Faster Web Sites: Performance Best Practices for Web Developers 22
  • 23. 23
  • 24. Thanks & Happy New Year 2011 24