How to be Successful with Responsive Sites (Koombea & NGINX) - English

42
BE RESPONSIVE WITH YOUR SITE @koombea #BeResponsive

Transcript of How to be Successful with Responsive Sites (Koombea & NGINX) - English

Page 1: How to be Successful with Responsive Sites (Koombea & NGINX) - English

BE RESPONSIVE WITH YOUR SITE

@koombea #BeResponsive

Page 2: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Speakers

David Bohorquez Front End Lead

Koombea

Rick Nelson Technical Solutions Architect

NGINX

@koombea #BeResponsive

Page 3: How to be Successful with Responsive Sites (Koombea & NGINX) - English

DAVID:

-  What is responsive & why? -  Which option should you choose? -  Web responsive Design Strategy -  Ways to build for responsive

RICK:

-  Why performance matters -  The impact of mobile -  Optimizing for performance

Agenda

@koombea #BeResponsive

Page 4: How to be Successful with Responsive Sites (Koombea & NGINX) - English

What is responsive & why?

-  Came out a couple of years ago. -  Designing a website or web enabled app that can adjust and

perform optimally for whichever device accesses it. -  Mobile usage increased & became a necessity.

@koombea #BeResponsive

Page 6: How to be Successful with Responsive Sites (Koombea & NGINX) - English

90% of people use multiple screens sequentially. (Source: uberflip)

                   

66% of smartphone & tablet users are frustrated with page load times. (Source SEO

social)

@koombea #BeResponsive

Click here to tweet it!

Click here for the stat!

Page 8: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Mobile Version

Pro’s: - Dedicated Mobile Version. Requires you to build a separate site. - Optimize for mobile. - Less/Simpler work. Better for rapid mobile presence. Con’s:  

- Maintain 2 separates sites. - 2 URLs duplicates SEO (good or bad).

@koombea #BeResponsive

Page 9: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Pro’s: - Dedicated marketplace. Ex: App Store or Google Play. - Makes better use of device hardware & new features. Better performance. Con’s:  

- Requires one App for each different platform. - Process of submission (takes a long time). - More money.

Native App

Page 10: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Pro’s:  

- Requires you to build only one site. - Lower dev cost. - Long run: Is future-friendlier. -  Less maintenance. -  Only worry about one site. - Faster deploy Con’s:  

- Requires more complex work. - Because you have to build for every device it is accessed from.

Responsive

Page 11: How to be Successful with Responsive Sites (Koombea & NGINX) - English

1.  Marketing Site (Usually yes). 2.  Web App (Depends). 3. E-commerce (Usually yes).

Should you build for responsive?

@koombea #BeResponsive

Page 12: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Shopify, Zappos, Amazon, eBay

Page 13: How to be Successful with Responsive Sites (Koombea & NGINX) - English

My Artisan Ink Responsive Case Study

Click here to see the Responsive Site built by Koombea- have fun!

Page 14: How to be Successful with Responsive Sites (Koombea & NGINX) - English

-  Graceful degradation. -  Mobile last

-  Progressive enhancement -  Mobile first -  Content first

Web Responsive Design Strategies

@koombea #BeResponsive

Page 16: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Detection tactics:  

- Device/OS/Browser detection (unreliable). - Feature detection. - What the device detection should be identifying are the capabilities of the device that is being used to access the website so that the appropriate elements of the site can be returned to the user.

Ways to build for Responsive

@koombea #BeResponsive

Click here to check out Modernizr!

Page 18: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Web performance matters

Page 19: How to be Successful with Responsive Sites (Koombea & NGINX) - English

• You may own the content and features, but your users are the ones in charge

• They alone decide:

• If you can’t provide your users with what they need, when they need it, they will go elsewhere.

• If your page has not loaded within 3 seconds, up to 40% of your users will giveup on you.

Which  sites  they  visit   The  apps  they  need  The  performance  they’ll  tolerate   When  to  give  up  

Your users are in charge

Click here to read more stats.

Page 20: How to be Successful with Responsive Sites (Koombea & NGINX) - English

“We want you to be able to flick from one page to another as quickly as you can flick a page on a book. So we’re really aiming very, very high here… at something like 100 milliseconds.”

Urs Hölzle, Senior VP Operations, Google

Every user counts

It doesn’t matter how busy your site is:            

-  Flash Crowd -  HTTP Post Attack, Slow Read Attack

… they don’t know or care!  

Page 21: How to be Successful with Responsive Sites (Koombea & NGINX) - English

The Impact of Mobile Users

• More Users• With the ability to access your app at any time from anywhere• Events can explode and cause massive spikes

– App upgrade– News event

• Slower connections• Lower Bandwidth

Page 22: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Mobile Apps vs. Mobile Web

• Mobile apps use API calls not web pages• More short requests• More connections• Support for Multiple App versions

Your server needs to handle millions of connections delivering short responses very quickly

Page 23: How to be Successful with Responsive Sites (Koombea & NGINX) - English

What can you do?

Page 24: How to be Successful with Responsive Sites (Koombea & NGINX) - English

No Silver Bullet

Page 25: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Internet

4 opportunities to optimize

Python  Ruby  node.js  Java  

Client Device Network Application Stack Code

Page 26: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Improve performance on Client Device

• Reduce HTTP GETs and bandwidth:– Merge and reduce resources– Smart control of client caching

• Rearrange resources to speed up rendering

• Your options:– Preprocess in Asset Pipeline– In-app (Google Pagespeed)– As-a-Service

Page 27: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Improve performance on the Network

• Faster resource downloads:– Content Delivery Network– Google SPDY– OCSP stapling

• Your options:– Use a CDN– Use NGINX+

Page 28: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Improve performance of the Application Stack

• What do we mean?

• The ‘Application Stack’ bridges HTTP trafficto your code, APIs and Static content

Internet

Your code: • Python,

Ruby,node.js, Java

APIs • Internal and

External APIs

“Static” Content • On disk• In database

HTTP  

Page 29: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Four steps to a faster application

Optimize HTTP processing

Scale the backend servers

Cache common responses

Be smart with your traffic

Page 30: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Hundreds of concurrent connections…

require hundreds of heavyweight threads or processes…

competing for limited CPU and memory

What is the challenge with HTTP?

Client-side: Slow network Multiple connections HTTP Keepalives

Server-side: Limited concurrency

Page 31: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Hundreds of concurrent connections…

handed by a small number of multiplexing processes,…

typically one process per core

NGINX architecture

Page 32: How to be Successful with Responsive Sites (Koombea & NGINX) - English

NGINX transforms application performance

• NGINX has almost-unlimited concurrency– Transforms worst-case traffic to best-case– Maximizes application utilization

Internet NSlow, high-concurrency

internet-side traffic Fast, efficient local-side traffic

Page 33: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Scale the Backend Servers Load Balancing

Internet N

þ   Improved  Applica@on  Availability  þ   Management  þ   Increased  Capacity  þ   Advanced  techniques  e.g.  A|B  tes@ng  

Why?   þ   DNS  Round  Robin  þ   Hardware  L4  load  balancer  þ   SoMware  Reverse  Proxy  LB  þ   Cloud  solu@on  

How?  

Page 34: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Cache common responses

GET  /logo.png  

GET  /logo.png  

Hybrid  on-­‐disk  and  in-­‐memory  cache  

N+

Page 35: How to be Successful with Responsive Sites (Koombea & NGINX) - English

What about dynamic content?

• Some  content  appears  to  be  un-­‐cacheable  • But  oMen  even  dynamic  content  can  be  cached

– Use  cache  purging– Use  fast  cache  @mes

Page 36: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Be smart with your traffic

• Priori@ze  and  rate-­‐limit  requests  and  responses  – Queues,  Rate-­‐limits,  Honeypots,  ACLs  

• Use  NGINX  Plus  to  its  full  poten@al  

Page 37: How to be Successful with Responsive Sites (Koombea & NGINX) - English

A NGINX Mobile Example

• Rou@ng  desktop  and  mobile  clients  differently  – Present  different  pages  to  mobile  clients  

map $http_user_agent $whichUpstream { ~iPhone mobile; ~Android mobile; default desktop; } Upstream mobile { server 192.168.100.100:8080; server 192.168.100.101:8080; } Upstream mobile { server 192.168.100.100:80; server 192.168.100.101:80; }

server { listen 80; location / {

proxy_pass http://$whichUpstream; } }

Page 38: How to be Successful with Responsive Sites (Koombea & NGINX) - English
Page 39: How to be Successful with Responsive Sites (Koombea & NGINX) - English

NGINX Plus

• NGINX  Open  Source  +  Advanced  Features– For  Example:

• Applica@on  Health  Checks• Session  Persistence  (S@cky  Sessions)• Advanced  Monitoring  and  Sta@s@cs• Cache  Purge• HLS  &  HDS  Video

Page 40: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Closing thoughts

• Applica@on  Performance  is  key  to  Applica@on  Success• Four  areas  you  should  focus  on:– The  Applica@on– The  Client– The  Network– The  Applica@on  Stack

• NGINX  accelerates  the  Mobile  Web  and  Mobile  Apps• NGINX  is  used  by  40%  of  the  top  10,000  sites

Page 41: How to be Successful with Responsive Sites (Koombea & NGINX) - English

Find out more

• hep://nginx.com  – Webinars,  Documenta@on,  Free  Trial  

• hep://nginx.org  – Open  Source,  Community,  Documenta@on  

• @nginx,  @nginxorg  • hep://nginx.com/nginxconf/  

The links are clickable!