Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Harnessing The Power of CDNs

1,755 views

Published on

Explain what is a CDN, its advantages, and how to exploit caching on the internet. I cover Akamai in specific, along practices around Cache Headers, Cookie less domains, Fingerprinting, etc.

This talk was delivered at GIDS Bangalore (Apr 2015).

Published in: Technology
  • Be the first to comment

Harnessing The Power of CDNs

  1. 1. Harnessing the Power of CDNs Gurpreet Luthra, Lead Consultant
  2. 2. Agenda • What is a CDN? • Brief on Akamai • Advantages of a CDN • Exploiting Caching • Statistics & Numbers • Architectural Considerations • Further References
  3. 3. About Me - Gurpreet Luthra • 13+ years, Developer & Lead Consultant • Working on Scala • Spent last few months harnessing Akamai • Twitter: _zenx_
  4. 4. What is a CDN? http://my-retail-store.com (GET)
  5. 5. What is a CDN? Hash Table Cache for all your HTTP Get Requests http://my-retail-store.com (GET)
  6. 6. What is a CDN? Ha Spread them all over the World! Ha Ha Ha Ha Ha Ha ORIGIN
  7. 7. 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
  8. 8. Examples of CDNs https://hostingreview360.com/top-5-cdn-providers/
  9. 9. Examples of CDNs
  10. 10. • 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
  11. 11. http://www.akamai.com/html/technology/real-time-web-monitor.html
  12. 12. How do I know if a website is using Akamai? 12
  13. 13. 13
  14. 14. https://control.akamai.com/EdgeAuth/login.jsp
  15. 15. https://control.akamai.com/EdgeAuth/login.jsp
  16. 16. 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
  17. 17. Types of Caches on the Internet • Web browser • Proxy • CDNs • Reverse Proxies • Web Server’s / Specialized Caches
  18. 18. What would we love? • Cache Forever • Deploy immediately
  19. 19. So… Exploit Caching…
  20. 20. HTTP Response Cache Headers • Expires • Cache-Control • Last-Modified • ETag
  21. 21. cache-control • max-age= (seconds) • s-maxage= • public • private • no-cache • must-revalidate • proxy-revalidate https://www.mnot.net/cache_docs/#CACHE-CONTROL
  22. 22. https://redbot.org/
  23. 23. Fingerprinting • Javascripts • CSS • Assets http://server.com/css/global-908e25f4bf641868d8683022a5b62f54.css
  24. 24. Fingerprinting HTML Pages Not fingerprinted 5 - 30 mins JS/CSS/Assets Fingerprinted 1 year Images 30 days - 1 year
  25. 25. Cookie-less Domain • Why submit cookies for every GET request for assets? http://my-assets-host.com/css/ global-908e25f4bf641868d8683022a5b62f54.css
  26. 26. Caching & SSL? http://www.akamai.com/dl/feature_sheets/fs_edgesuite_securecontentdelivery.pdf
  27. 27. 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)
  28. 28. Architectural Considerations • Page Fragments • User Centric Data - Client Side - AJAX • Mobile/Non-Mobile Views in one payload
  29. 29. FROM: http://ahcdn.com/en/
  30. 30. 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/
  31. 31. 40
  32. 32. Gurpreet Luthra http://techie-notebook.blogspot.com _zenx_

×