Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53
-
Upload
amazon-web-services -
Category
Technology
-
view
489 -
download
1
description
Transcript of Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53
![Page 1: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/1.jpg)
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
Dynamic Content Acceleration
Nihar Bihani, Amazon Web Services
July 10, 2014
![Page 2: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/2.jpg)
Fundamental Facts
• Any web application must have…
– Tight security
– High availability
– High performance
![Page 3: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/3.jpg)
Why Does Availability Matter?
• If your application is not available, your revenue loss is
100%.
• Impact to customer loyalty and your brand image.
![Page 4: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/4.jpg)
How AWS Helps?
• Use Amazon Route 53 to health-check your origin
webservers with automatic failover.
• Use Amazon CloudFront to front your origins to reduce load
on your origins.
• Use Amazon CloudFront to customize your error pages.
• Amazon CloudFront will automatically serve stale content
when origin is unavailable.
![Page 5: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/5.jpg)
Why Performance Matters?
• Performance translates to…
– Higher page views
– Better customer experience
– Higher conversion rates
![Page 6: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/6.jpg)
Why Performance Matters?
![Page 7: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/7.jpg)
Why Performance Matters?
• Great amount of time and money spent improving back-end
infrastructure performance.
• 80% of user’s perceived latency comes from front-end.
![Page 8: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/8.jpg)
How do we Improve Performance?
• A typical web application has…
– Static or Re-Usable content
• High TTLs
• Low TTLs (Customized Content)
• Can be cached
– Dynamic or Unique content
• Zero TTL
• Cannot be cached BUT affects 100% of your viewers!
![Page 9: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/9.jpg)
Elastic Load
Balancing
Dynamic Content
Amazon EC2
Static Content
Amazon S3 Custom Origin
OR
OR
Custom Origin
www.example.com/*.php
cdn.example.com/*.jpg
Typical Architecture
![Page 10: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/10.jpg)
Elastic Load
Balancing
Dynamic Content
Amazon EC2
Static Content
Amazon S3 Custom Origin
OR
OR
Custom Origin*.php
*.jpg
Amazon CloudFront
www.example.com
Why Not?
![Page 11: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/11.jpg)
Why Don’t Customers Use CDNs for Dynamic Content?
I don’t see the value - each request is unique and must go
back to the origin web server.
I see the value, but my current CDN charges premium rates
for dynamic content acceleration, with many additional fees.
Configuring a CDN for dynamic content acceleration requires
expensive professional services and is not self-service.
![Page 12: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/12.jpg)
How Can Amazon CloudFront Help?
• TCP/IP optimizations for the network path
• Keep-Alive connections to reduce RTT
• SSL termination close to viewers
• POST/PUT upload optimizations
• Latency based routing
• Low prices; same as static content delivery!
![Page 13: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/13.jpg)
Re-Usable or Unique Content?
• Static or Re-Usable
– A given content where the state of the content does NOT change for
a given period of time.
t
0
t
1
![Page 14: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/14.jpg)
Re-Usable or Unique Content?
• Dynamic or Unique
– A given content where the state of the content changes as soon as it
gets created.
t
0
t
1
![Page 15: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/15.jpg)
Example
![Page 16: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/16.jpg)
Example
Index.jsp (Dynamic)
Images (Static)
![Page 17: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/17.jpg)
Example
. Sec
![Page 18: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/18.jpg)
Page Load Time?
. Sec
![Page 19: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/19.jpg)
Improving Web Application Performance
• Accelerating static content
• Accelerating dynamic content
![Page 20: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/20.jpg)
Brief Introduction to Waterfall Graphics
• What happens?
What happens in betweenTyping the address Browser renders
![Page 21: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/21.jpg)
Waterfall Graphs
• Most important tool in web performance measurement
• Most browsers provide Waterfall Graph plugins
![Page 22: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/22.jpg)
Understanding Waterfall Graphs
TCP connection Content download
DNS lookup
Time to first byte
![Page 23: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/23.jpg)
Understanding Waterfall Graphs
![Page 24: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/24.jpg)
Understanding Waterfall Graphs
index.jsp
![Page 25: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/25.jpg)
Optimizing Static Content
• Content is static: images, JS, CSS
– It can be distributed to more than one user.
– State of the object does not change: sec, minute, hours, etc.
– Caching is a way to server static content to more than one user.
![Page 26: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/26.jpg)
Amazon S3 Custom
OR
Optimizing Static Content with Caching
User request A Edge location
Origin
![Page 27: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/27.jpg)
Amazon S3 Custom
OR
Optimizing Static Content with Caching
User request A Edge location
Origin
Get image
![Page 28: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/28.jpg)
Amazon S3 Custom
OR
Optimizing Static Content with Caching
User request A Edge location
Origin
Get image Get image
![Page 29: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/29.jpg)
Amazon S3 Custom
OR
Optimizing Static Content with Caching
User request A Edge location
Origin
Get image Get image
Image
![Page 30: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/30.jpg)
Amazon S3 Custom
OR
Optimizing Static Content with Caching
User request A Edge location
Origin
Get image Get image
ImageImage
![Page 31: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/31.jpg)
Amazon S3 Custom
OR
Optimizing Static Content with Caching
User request B Edge location
Origin
![Page 32: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/32.jpg)
Amazon S3 Custom
OR
Optimizing Static Content with Caching
User request B Edge location
Origin
Get image
![Page 33: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/33.jpg)
Amazon S3 Custom
OR
Optimizing Static Content with Caching
User request B Edge location
Origin
Get image
Image
![Page 34: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/34.jpg)
Optimizing Static Content with Caching
• Bring content closer to the users
• Improves the experience and performance
• Offloads your infrastructure
![Page 35: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/35.jpg)
Optimizing Static Content with Caching
• Before caching = 1.46 seconds
![Page 36: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/36.jpg)
Optimizing Static Content with Caching
• After caching = 770 milliseconds
![Page 37: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/37.jpg)
• Are we done? Not so fast! Goal is 0.5 seconds.
Optimizing Static Content with Caching
index.jsp
![Page 38: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/38.jpg)
Optimizing Static Content with Caching
• Cache as much as you can.
• How? I’m caching all my images, CSS, and JS.
• Find cacheable content.
– Collect web (w3c) logs from your web-tier
– Run a report on your logs (EMR, RDS, or Redshift)
– Identify top N URLs
![Page 39: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/39.jpg)
Optimizing Static Content with Caching
• Steps to find cacheable content
– Example query
Select count(url) count, url from logs_tableGroup by url sort by count;
![Page 40: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/40.jpg)
Optimizing Static Content with Caching
• Report example
![Page 41: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/41.jpg)
Re-Usable or Unique Content?
• Static or Re-Usable
– A given content where the state of the content does NOT change for
a given period of time.
t
0
t
1
![Page 42: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/42.jpg)
Caching for Smaller Time Units
• Goal: find content that can be cached for any given period
of time.
– Hours
– Minutes
– Seconds
• CloudFront can cache content for any period of time.
![Page 43: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/43.jpg)
Optimizing Static Content with Caching
• Content with query strings
• Reusable?
• CloudFront can cache content with query strings.
• Every unique query-string combination is a new object in
CloudFront’s cache.
110 /factor/create_image?name=book1&size=10x10
![Page 44: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/44.jpg)
Optimizing Static Content with Caching
• API calls
• Reusable?
• CloudFront can cache content with query strings.
• Every unique query-string combination is a new object in
CloudFront’s cache.
100 /api/GetBooks?category=math
![Page 45: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/45.jpg)
Caching for Smaller Time Units
• Imagine your have a read heavy API GETS hit 100 or 1,000
RPS.
• Offload your web-tier from handling 1,000 RPS.
• Offload your load balancer; Elastic Load Balancing or any
other LB.
• Provision less capacity and reduce costs.
100 /api/GetBooks?category=math
![Page 46: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/46.jpg)
Caching Personalized Content Just Launched!
• Optionally configure CloudFront to forward request headers
to your origin.
• Enables caching for personalized content:
• Mobile Device Detection
• Geo Targeting
• Multi-Site Hosting
• Cross Origin Resource Sharing (CORS)
• Protocol Detection
![Page 47: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/47.jpg)
Base Page (First HTML Page)
• Re-usable?
220 /index.jsp
![Page 48: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/48.jpg)
Optimizing Dynamic Content
index.jsp
![Page 49: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/49.jpg)
Optimizing Dynamic Content
index.jsp
![Page 50: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/50.jpg)
Optimizing Dynamic Content
• Can dynamic content be optimized?
– Dynamic content is not cacheable.
– Content can be “proxied” by CDN to the origin and back.
![Page 51: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/51.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
![Page 52: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/52.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
![Page 53: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/53.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
Get
![Page 54: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/54.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
Get
Response
![Page 55: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/55.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
Get
Response
![Page 56: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/56.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
![Page 57: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/57.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
![Page 58: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/58.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
Get
![Page 59: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/59.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
Get
Response
![Page 60: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/60.jpg)
Amazon S3 Custom
OR
Optimizing Dynamic Content
User request A
Edge location
Origin
User request B
Get
Response
![Page 61: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/61.jpg)
Optimizing Dynamic Content
• Can dynamic content be optimized?
– That adds latency?
– How to optimize dynamic content?
– Response time = ∑ Time (DNS + Connection + First Byte + Content
Download)
DNS lookup
Content downloadTCP connection
Time to first byte
![Page 62: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/62.jpg)
Faster Response Time =
Reduced DNS Time
+
Reduced Connection Time
+
Reduced First Byte Time
+
Reduced Content Download Time
Optimizing Dynamic Content
![Page 63: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/63.jpg)
Faster Response Time =
Reduced DNS Time
+
Reduced Connection Time
+
Reduced First Byte Time
+
Reduced Content Download Time
Optimizing Dynamic Content
![Page 64: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/64.jpg)
Keep-Alive connections
& SSL termination
Faster Response Time =
Reduced DNS Time
+
Reduced Connection Time
+
Reduced First Byte Time
+
Reduced Content Download Time
Optimizing Dynamic Content
![Page 65: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/65.jpg)
Keep-Alive connections
& SSL termination
Faster Response Time =
Reduced DNS Time
+
Reduced Connection Time
+
Reduced First Byte Time
+
Reduced Content Download Time
Keep-Alive connections
Optimizing Dynamic Content
![Page 66: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/66.jpg)
Keep-Alive connections
& SSL termination
Faster Response Time =
Reduced DNS Time
+
Reduced Connection Time
+
Reduced First Byte Time
+
Reduced Content Download Time
Keep-Alive connections
TCP/IP optimization
Optimizing Dynamic Content
![Page 67: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/67.jpg)
Optimizing Dynamic Content
• After caching/before CloudFront dynamic acceleration =
770 milliseconds
![Page 68: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/68.jpg)
• How to optimize DNS response time? – with Route 53
Optimizing DNS Response Time
DNS lookup
![Page 69: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/69.jpg)
• Amazon Route 53 managed DNS offering
• Designed for high availability
• Low latency DNS resolution
• Global network of DNS servers
• Queries routed to nearest DNS server
Optimizing DNS Response Time
![Page 70: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/70.jpg)
Without Route 53
![Page 71: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/71.jpg)
With Route 53
![Page 72: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/72.jpg)
• How to optimize TCP connections? – with CloudFront Keep
Alive connections.
Optimizing TCP Connections and First Byte
TCP connection
Amazon CloudFront
Keep-Alive Connections
![Page 73: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/73.jpg)
• TCP/IP handshake
– HTTP runs on TCP/IP
– TCP has the concept of TCP handshake
– Every HTTP connection has to complete TCP handshake
– TCP/IP handshake penalizes dynamic content
Optimizing TCP Connections
![Page 74: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/74.jpg)
Two Users without CloudFront
90ms
Region
![Page 75: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/75.jpg)
Two Users without CloudFront
SYN
90ms
Region
![Page 76: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/76.jpg)
Two Users without CloudFront
SYN
SYN-ACK
90ms
Region
![Page 77: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/77.jpg)
Two Users without CloudFront
SYN
SYN-ACK
ACK
GET /index.jsp
90ms
Region
![Page 78: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/78.jpg)
Two Users without CloudFront
360ms
SYN
SYN-ACK
ACK
GET /index.jsp
90ms
Region
![Page 79: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/79.jpg)
Two Users without CloudFront
360ms
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
90ms
Region
![Page 80: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/80.jpg)
Two Users without CloudFront
360ms
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
SYN-ACK
90ms
Region
![Page 81: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/81.jpg)
Two Users without CloudFront
360ms
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
SYN-ACK
ACK
GET /index.jsp
90ms
Region
360ms
![Page 82: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/82.jpg)
• Every user is a new connection.
• More users = more TCP connections.
Without CloudFront
Region
![Page 83: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/83.jpg)
• Every user is a new connection.
• More users = more TCP connections.
Without CloudFront
Region
![Page 84: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/84.jpg)
• Every user is a new connection.
• More users = more TCP connections.
Without CloudFront
Region
![Page 85: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/85.jpg)
• Every user is a new connection.
• More users = more TCP connections.
Without CloudFront
Region
![Page 86: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/86.jpg)
• Without Keep-Alive connections
– Puts load on memory/CPU
– Puts load on your web servers
– Load on your web servers, increases the time to first byte.
Optimizing TCP Connections
![Page 87: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/87.jpg)
Two Users with CloudFront Keep-Alive
SYN
60ms30ms
Region
![Page 88: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/88.jpg)
Two Users with CloudFront Keep-Alive
SYN
SYN-ACK
60ms30ms
Region
![Page 89: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/89.jpg)
Two Users with CloudFront Keep-Alive
SYN
SYN-ACK
ACK
GET /index.jsp
60ms30ms
Region
![Page 90: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/90.jpg)
Two Users with CloudFront Keep-Alive
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
60ms30ms
Region
![Page 91: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/91.jpg)
Two Users with CloudFront Keep-Alive
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
SYN-ACK
60ms30ms
Region
![Page 92: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/92.jpg)
Two Users with CloudFront Keep-Alive
360ms
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
SYN-ACK
ACK
GET /index.jsp
60ms30ms
Region
![Page 93: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/93.jpg)
Two Users with CloudFront Keep-Alive
360ms
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
SYN-ACK
ACK
GET /index.jsp
60ms
SYN
30ms
Region
![Page 94: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/94.jpg)
Two Users with CloudFront Keep-Alive
360ms
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
SYN-ACK
ACK
GET /index.jsp
60ms
SYN
SYN-ACK
30ms
Region
![Page 95: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/95.jpg)
Two Users with CloudFront Keep-Alive
360ms
SYN
SYN-ACK
ACK
GET /index.jsp
SYN
SYN-ACK
ACK
GET /index.jsp
60ms
SYN
SYN-ACK
ACK
GET /index.jsp
30ms
Region
GET /index.jsp
180ms
![Page 96: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/96.jpg)
• CloudFront Keep-Alive connections
– More users does not have to equal more TCP connections
– Without CloudFront two users equal two connections
– With CloudFront two users equal one connection
– Offloads your web tier’s CPU/memory
– Improves response time
– Without CloudFront two users equal 720ms
– With CloudFront two users equal 540ms
Optimizing TCP Connections
![Page 97: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/97.jpg)
Optimizing TCP Connections
Test CPU Util. %
Without CloudFront 20%
With CloudFront 6%
![Page 98: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/98.jpg)
• How to optimize SSL connections? – with CloudFront SSL
termination.
Optimizing SSL Connections
TCP connection
Amazon CloudFront
SSL termination
![Page 99: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/99.jpg)
• CloudFront has the ability to support SSL traffic.
• Use CloudFront cert or bring your own.
• SSL traffic gets terminated at the closet CloudFront
location.
Optimizing SSL Connections
![Page 100: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/100.jpg)
• Taking advantage of Keep-Alive connections
– SSL introduces additional TCP handshake packets.
– Keep-Alive eliminates additional SSL TCP handshake packets
– Offloading your infrastructure from terminating 1,000s of end-users
SSL connections.
Optimizing SSL Connections
![Page 101: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/101.jpg)
• Two optimization patterns:
– Half bridge SSL termination
– Full bridge SSL termination
SSL Optimization Patterns with CloudFront
![Page 102: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/102.jpg)
Half Bridge SSL Termination
CloudFront
HTTP
• Better performance by leveraging HTTP connections to
origin
Region
![Page 103: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/103.jpg)
Full Bridge SSL Termination
CloudFront
HTTPS
Region
![Page 104: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/104.jpg)
• How to optimize content download time? – with CloudFront
Slow Start Optimization
Optimizing Content Download
Content download
Amazon CloudFront
Slow Start optimization
![Page 105: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/105.jpg)
TCP Slow Start
![Page 106: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/106.jpg)
TCP Slow Start
Packet 1
![Page 107: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/107.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
![Page 108: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/108.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Packet 2
Packet 3
![Page 109: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/109.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Packet 2
Packet 3
Packet 3 ACK
![Page 110: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/110.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Packet 2
Packet 3
Packet 3 ACK
Packet 4
Packet 5
Packet 6
![Page 111: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/111.jpg)
• CloudFront can optimize slow start for new connections.
• CloudFront uses existing connections so users can skip slow
start.
• Users benefit from TCP window optimized with an existing
connection.
• More packets transferred in a single round trip.
Optimizing Content Download
![Page 112: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/112.jpg)
TCP Slow Start
Region
![Page 113: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/113.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Region
![Page 114: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/114.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Packet 2
Packet 3
Region
![Page 115: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/115.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Packet 2
Packet 3
Packet 3 ACK
Region
![Page 116: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/116.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Packet 2
Packet 3
Packet 3 ACK
Packet 4
Packet 5
Packet 6
Region
![Page 117: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/117.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Packet 2
Packet 3
Packet 3 ACK
Packet 4
Packet 5
Packet 6
Packet 1
Packet 2
Packet 3
Packet 4
Region
![Page 118: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/118.jpg)
TCP Slow Start
Packet 1
Packet 1 ACK
Packet 2
Packet 3
Packet 3 ACK
Packet 4
Packet 5
Packet 6
Packet 1
Packet 2
Packet 3
Packet 4
Packet 4 ACK
Packet 5
Packet 6
Packet 7
Region
![Page 119: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/119.jpg)
• Without CloudFront
• With CloudFront
Performance Tests
Oregon Virginia
Oregon Virginia
![Page 120: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/120.jpg)
Performance Tests Results
Test # Of Packets Response Time Per RequestResponse Time For 200
Requests
Without CloudFront
2605 170 ms 33.876 s
WithCloudFront
896 96 ms 19.24 s
![Page 121: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/121.jpg)
• How to optimize content PUT/POST? – with CloudFront
PUT/POST Verb optimization
Optimizing PUT/POST
TCP connection
Amazon CloudFront
PUT/POST Verb optimization
![Page 122: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/122.jpg)
• CloudFront can support verbs: PUT, POST, DELETE,
OPTIONS, and PATCH.
• Data won’t get cached.
• CloudFront can proxy data to origin.
Optimizing PUT/POST
![Page 123: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/123.jpg)
• Dynamic content optimizations apply
– Keep-Alive connections
– TCP Slow Start optimization
– Close proximity connection termination
Optimizing PUT/POST
![Page 124: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/124.jpg)
• Optimizing form POSTs
• Optimizing AJAX POST requests
• Optimizing content upload
– Uploading to Amazon S3
Optimizing PUT/POST
![Page 125: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/125.jpg)
Optimizing PUT/POST Performance Tests
Oregon Virginia
Upload
![Page 126: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/126.jpg)
Optimizing PUT/POST Performance Tests
Oregon Virginia
Upload
• Uploading 10MB data from an instance in US East region to
US West region: average result is 5 seconds.
![Page 127: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/127.jpg)
Optimizing PUT/POST Performance Tests
Oregon Virginia
• Uploading 10MB data from an instance in US East region to
closest CloudFront location: average result is 3.5 seconds.
![Page 128: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/128.jpg)
• How to optimize content download even more? – with
Route 53
Optimizing Content Download – Even More!
Content download
![Page 129: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/129.jpg)
• Latency Based Routing (LBR)
• Run multiple stacks of your application in different AWS
regions around the world.
• Create LBR records for each location and tag the location
with GEO information.
• Route 53 will route end users to the endpoint that provides
the lowest latency.
Optimizing Content Download – Even More!
![Page 130: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/130.jpg)
• LBR Benefits
– Better performance than running instances in single region.
– Improved reliability relative to running in a single region.
– Easier implementation than traditional DNS solutions.
– Much lower prices than traditional DNS solutions.
Optimizing Content Download – Even More!
![Page 131: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/131.jpg)
Optimizing Content Download – Even More!
![Page 132: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/132.jpg)
Optimizing Content Download – Even More!
![Page 133: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/133.jpg)
• Use CloudFront for dynamic content optimization
• Host your origin at multiple AWS locations (or data centers)
– US
– Europe
Optimizing Content Download – Even More!
![Page 134: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/134.jpg)
• Create origin DNS records in Route 53 at each location.
• Route 53 measures the latency between CloudFront and all
configured origins.
• Route 53 resolves origin’s hostname to the closest location.
• Reduce download time.
Optimizing Content Download – Even More!
![Page 135: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/135.jpg)
Optimizing Content Download – Even More!
![Page 136: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/136.jpg)
Optimizing Content Download – Even More!
![Page 137: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/137.jpg)
Lower Latency with CloudFront & Route 53
![Page 138: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/138.jpg)
Lower Latency with CloudFront & Route 53
![Page 139: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/139.jpg)
Lower Latency with CloudFront & Route 53
![Page 140: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/140.jpg)
Lower Latency with CloudFront & Route 53
![Page 141: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/141.jpg)
Lower Latency with CloudFront & Route 53
![Page 142: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/142.jpg)
Lower Latency with CloudFront & Route 53
![Page 143: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/143.jpg)
Lower Latency with CloudFront & Route 53
![Page 144: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/144.jpg)
Lower Latency with CloudFront & Route 53
![Page 145: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/145.jpg)
Lower Latency with CloudFront & Route 53
![Page 146: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/146.jpg)
Lower Latency with CloudFront & Route 53
![Page 147: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/147.jpg)
Lower Latency with CloudFront & Route 53
![Page 148: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/148.jpg)
Lower Latency with CloudFront & Route 53
![Page 149: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/149.jpg)
Lower Latency with CloudFront & Route 53
![Page 150: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/150.jpg)
• Optimization equals 55 milliseconds
Optimizing Content Download – Even More!
![Page 151: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/151.jpg)
• CloudFront & Route 53
• Normal interaction
– Users connect to CloudFront
– CloudFront connects to origin
Design For Failure
CloudFront
Region
![Page 152: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/152.jpg)
• What happens if the origin fails to respond to CloudFront?
Design For Failure
CloudFront
Region
![Page 153: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/153.jpg)
• Failures can be detected by Route 53 health checks.
Design For Failure
Region
Health checks
![Page 154: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/154.jpg)
• The traffic shifts to the healthy instances or load balancers.
Design For Failure
Region
CloudFront
Health checks
![Page 155: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/155.jpg)
• Can mix health checks and LBR.
• Can apply the same logic to multi-region deployments.
• Users get connected to the closest region if both regions
are healthy.
• Route 53 detects failures via health checks.
• Users get connected to the healthy region if the closest
region is not passing the health check.
Design For Failure
Region
![Page 156: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/156.jpg)
Design For Failure
Region2
CloudFront
Health checksHealth checks
Region1
![Page 157: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/157.jpg)
• Caching improves performance.
• Caching can also improve availability.
• If your infrastructure is experiencing failure, CloudFront can
server cached content instead of 5xx, 4xx, etc.
Design For Failure
Region
![Page 158: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/158.jpg)
Amazon S3 Custom
OR
Design for Failure
User request A Edge location
Origin
![Page 159: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/159.jpg)
Amazon S3 Custom
OR
Design for Failure
User request A Edge location
Origin
Get image
![Page 160: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/160.jpg)
Amazon S3 Custom
OR
Design for Failure
User request A Edge location
Origin
Get image Get image
![Page 161: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/161.jpg)
Amazon S3 Custom
OR
Design for Failure
User request A Edge location
Origin
Get image Get image
Image
![Page 162: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/162.jpg)
Amazon S3 Custom
OR
Design for Failure
User request A Edge location
Origin
Get image Get image
ImageImage
![Page 163: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/163.jpg)
Amazon S3 Custom
OR
Design for Failure
User request B Edge location
Origin
![Page 164: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/164.jpg)
Amazon S3 Custom
OR
Design for Failure
User request B Edge location
Origin
Get image
![Page 165: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/165.jpg)
Amazon S3 Custom
OR
Design for Failure
User request A Edge location
Origin
Get image Get image
![Page 166: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/166.jpg)
Amazon S3 Custom
OR
Design for Failure
User request A Edge location
Origin
Get image Get image
![Page 167: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/167.jpg)
Amazon S3 Custom
OR
Design for Failure
User request A Edge location
Origin
Get image Get image
Image
![Page 168: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/168.jpg)
• Accelerate all your content with CloudFront.
• Use CloudFront with Route 53 LBR to improve your
performance.
• Design for failure with CloudFront and Route 53.
Summary
Region
![Page 169: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/169.jpg)
Customer Stories
• Low TTLs
![Page 170: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/170.jpg)
Customer Stories
• Query Strings
![Page 171: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/171.jpg)
Customer Stories
• Cookies
![Page 172: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/172.jpg)
• PUT/POST
– “We are excited to use CloudFront's new POST, PUT, PATCH, and DELETE
capabilities to accelerate our RESTful APIs on Amazon EC2. With these
new HTTP methods we can now take advantage of CloudFront’s global
footprint and optimized connections back to our origin servers in AWS.
Routing our customers’ API requests via a CloudFront edge location near
them will help improve their experience by minimizing packet loss and
upload latency. This will help provide a streamlined experience for our
customers.” Ilan Rabinovitch, Tech Lead, Site Reliability Engineering
Customer Stories
Region
![Page 173: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/173.jpg)
• Custom SSL
Customer Stories
Region
![Page 174: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/174.jpg)
• Health Checks and Failover
– “Amazon Route 53’s DNS Failover feature provides high availability
across our multiple AWS regions and gives us the ability to offload
our origins.”
Customer Stories
Region
![Page 175: Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront and Amazon Route 53](https://reader034.fdocuments.net/reader034/viewer/2022051512/540d6f878d7f72767e8b49a0/html5/thumbnails/175.jpg)
• AWS Free Usage Tier
• 50 GB CloudFront Data Transfer per Month
• 2,000,000 HTTP/HTTPS Requests per Month
• Learn More: http://aws.amazon.com/free/
• Office Hours with CloudFront Engineers
• July 30th, 2014
• 10 – 11am (PST)
• Register Here: http://aws.amazon.com/cloudfront/
Get Started with CloudFront
Region