YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Harnessing The Power of CDNs

Harnessing the Power of CDNsGurpreet Luthra, Lead Consultant

Page 2: Harnessing The Power of CDNs

Agenda

• What is a CDN? • Brief on Akamai • Advantages of a CDN • Exploiting Caching • Statistics & Numbers • Architectural Considerations • Further References

Page 3: Harnessing The Power of CDNs

About Me - Gurpreet Luthra• 13+ years, Developer & Lead Consultant • Working on Scala • Spent last few months harnessing Akamai • Twitter: _zenx_

Page 4: Harnessing The Power of CDNs

What is a CDN?

http://my-retail-store.com (GET)

Page 5: Harnessing The Power of CDNs

What is a CDN?

Hash Table

Cache for all your HTTP Get Requests

http://my-retail-store.com (GET)

Page 6: Harnessing The Power of CDNs

What is a CDN?

Ha

Spread them all over the World!

Ha

Ha

Ha

Ha

Ha

HaORIGIN

Page 7: Harnessing The Power of CDNs

CDN Distribution Scheme

"NCDN - CDN" by Kanoha - Own work. Licensed under CC BY-SA 3.0 via Wikimedia Commons http://commons.wikimedia.org/wiki/File:NCDN_-_CDN.png#/media/File:NCDN_-_CDN.png

Page 8: Harnessing The Power of CDNs

Examples of CDNs

https://hostingreview360.com/top-5-cdn-providers/

Page 9: Harnessing The Power of CDNs

Examples of CDNs

Page 10: Harnessing The Power of CDNs

• 15-30% of all Web Traffic • $1.96 Billion Annual Revenue • 5000+ employees • 170,000 Servers in 102 countries • 2 trillion daily Internet interactions

http://www.akamai.com/html/about/facts_figures.html

Page 11: Harnessing The Power of CDNs

http://www.akamai.com/html/technology/real-time-web-monitor.html

Page 12: Harnessing The Power of CDNs

How do I know if a website is using Akamai?

12

Page 13: Harnessing The Power of CDNs

13

Page 14: Harnessing The Power of CDNs
Page 15: Harnessing The Power of CDNs
Page 16: Harnessing The Power of CDNs
Page 17: Harnessing The Power of CDNs
Page 18: Harnessing The Power of CDNs

https://control.akamai.com/EdgeAuth/login.jsp

Page 19: Harnessing The Power of CDNs

https://control.akamai.com/EdgeAuth/login.jsp

Page 20: Harnessing The Power of CDNs
Page 21: Harnessing The Power of CDNs

Recap — Why CDN?

• Caching: Reduced Page Construction Time • Closer: Reduced Latency • Traffic Offloaded: Reduced Loads • Backup: Served even if site is down • Protection: Prevent DoS Attacks • Others: Redirects/Auto-compression/Best-route

detection

Page 22: Harnessing The Power of CDNs
Page 23: Harnessing The Power of CDNs

Types of Caches on the Internet

• Web browser • Proxy • CDNs • Reverse Proxies • Web Server’s / Specialized Caches

Page 24: Harnessing The Power of CDNs

What would we love?

• Cache Forever

• Deploy immediately

Page 25: Harnessing The Power of CDNs

So… Exploit Caching…

Page 26: Harnessing The Power of CDNs

HTTP Response Cache Headers

• Expires • Cache-Control

• Last-Modified • ETag

Page 27: Harnessing The Power of CDNs

cache-control

• max-age= (seconds) • s-maxage= • public • private • no-cache • must-revalidate • proxy-revalidate

https://www.mnot.net/cache_docs/#CACHE-CONTROL

Page 28: Harnessing The Power of CDNs

https://redbot.org/

Page 29: Harnessing The Power of CDNs
Page 30: Harnessing The Power of CDNs

Fingerprinting

• Javascripts • CSS • Assets

http://server.com/css/global-908e25f4bf641868d8683022a5b62f54.css

Page 31: Harnessing The Power of CDNs

Fingerprinting

HTML Pages Not fingerprinted

5 - 30 mins

JS/CSS/Assets Fingerprinted 1 year

Images 30 days - 1 year

Page 32: Harnessing The Power of CDNs
Page 33: Harnessing The Power of CDNs
Page 34: Harnessing The Power of CDNs

Cookie-less Domain

• Why submit cookies for every GET request for assets?

http://my-assets-host.com/css/global-908e25f4bf641868d8683022a5b62f54.css

Page 35: Harnessing The Power of CDNs

Caching & SSL?

http://www.akamai.com/dl/feature_sheets/fs_edgesuite_securecontentdelivery.pdf

Page 36: Harnessing The Power of CDNs

Impact on one Website

• 85% - 90% Traffic offloaded to Akamai • MONTH

• Assets: 100 GB (3KB Cookie) • Assets: 16 Million requests • Traffic: 47 TB (Akamai) • Traffic: 4 TB (Origin) • Peak: 742 Hits/sec (Akamai) • Peak: 47 Hits/sec (Origin)

Page 37: Harnessing The Power of CDNs

Architectural Considerations

• Page Fragments • User Centric Data - Client Side - AJAX • Mobile/Non-Mobile Views in one payload

Page 38: Harnessing The Power of CDNs

FROM: http://ahcdn.com/en/

Page 39: Harnessing The Power of CDNs

Further References

• The minimum about Web caching you should know: https://www.mnot.net/cache_docs

• http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/

• http://guides.rubyonrails.org/asset_pipeline.html • http://www.ietf.org/rfc/rfc2616.txt (Section 14.9) • http://ocw.mit.edu/courses/mathematics/18-996-topics-in-

theoretical-computer-science-internet-research-problems-spring-2002/lecture-notes/

• http://www.akamai.com/dl/technical_publications/GloballyDistributedContentDelivery.pdf

• Image Credits: http://publicdomainvectors.org/

Page 40: Harnessing The Power of CDNs

40

Page 41: Harnessing The Power of CDNs

Gurpreet Luthrahttp://techie-notebook.blogspot.com

_zenx_

Page 42: Harnessing The Power of CDNs

Related Documents