Top Banner
CIRCUIT – An Adobe Developer Event Presented by ICF Interactive Akamai: Caching and Beyond Puru Hemnani
41
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CIRCUIT 2015 - Akamai:  Caching and Beyond

CIRCUIT – An Adobe Developer Event Presented by ICF Interactive

Akamai: Caching and Beyond

Puru Hemnani

Page 2: CIRCUIT 2015 - Akamai:  Caching and Beyond

whoami

•  Puru Hemnani, Sr. Systems/Cloud Architect at ICF Cloud Services division

•  Former Java/Application Developer •  Experience/Responsibilities

– System/Application Performance Tuning – DevOps/Automation – Build systems/Infrastructure for High

availability and Fault tolerance.

Page 3: CIRCUIT 2015 - Akamai:  Caching and Beyond

Scope

•  What is it all about – What are CDNs and why are they important in

today’s day and age – Overview of Akamai – Tuning Akamai for caching – Security – Mobile Optimization

Page 4: CIRCUIT 2015 - Akamai:  Caching and Beyond

Content Delivery

Networks (CDN)

Page 5: CIRCUIT 2015 - Akamai:  Caching and Beyond

What is CDN

•  Content Delivery Network is a large distributed system of servers deployed in multiple datacenters across the internet.

•  It serves the purpose of delivering content/data to the end user with lower latency, high availability and higher performance.

•  CDN brings static content closer to users. •  CDNs accelerate dynamic content •  CDN defends and absorb security threats

Page 6: CIRCUIT 2015 - Akamai:  Caching and Beyond

Without CDN

Page 7: CIRCUIT 2015 - Akamai:  Caching and Beyond

With CDN

Page 8: CIRCUIT 2015 - Akamai:  Caching and Beyond

CDN Providers…

Page 9: CIRCUIT 2015 - Akamai:  Caching and Beyond

Akamai

•  Akamai is one of the most prominent players in the CDN space and is the global leader.

•  Akamai delivers 30% of all internet traffic. •  Akamai daily traffic often exceeds 25

terabits per second. •  Akamai has more than 175,000 servers in

over 100 countries within over 1300 networks

Page 10: CIRCUIT 2015 - Akamai:  Caching and Beyond

Why Akamai

•  Scalability – Akamai provides unlimited capacity and scale

•  Speed – Lower latency by placing the content close to

end user •  Reduced origin cost

– Reduced origin footprint resulting in efficiency •  Security

–  In built protection from DDOS and other types of cyber attacks.

Page 11: CIRCUIT 2015 - Akamai:  Caching and Beyond

Some traffic stats

Page 12: CIRCUIT 2015 - Akamai:  Caching and Beyond

Limitations of AEM for High Traffic Site

•  AEM uses java based container for serving the sites

•  Frequently changing content •  Dispatcher cache has several limitations

– Cache invalidations – No TTLs – Treatment of query strings

•  Extensibility makes it vulnerable to security threats

Page 13: CIRCUIT 2015 - Akamai:  Caching and Beyond

Tuning Basics

•  Understanding your site and content – Static vs Dynamic content – Sessions and personalization – DAM assets vs html content – Advertising data – Traffic patterns – Application layer code stats – Use of Java scripts for personalization

Page 14: CIRCUIT 2015 - Akamai:  Caching and Beyond

WebPageTest can help

Page 15: CIRCUIT 2015 - Akamai:  Caching and Beyond

WebPageTest Summary

Page 16: CIRCUIT 2015 - Akamai:  Caching and Beyond

Tuning Akamai: Why

•  Akamai provides a vast range of tuning parameters and configuration options. If not tuned properly: – Low origin offload – Too fresh content – Poor site performance – Publishers crashing due to traffic spikes

Page 17: CIRCUIT 2015 - Akamai:  Caching and Beyond

Control TTLs at Origin

•  Akamai makes is easy to control cache objects Time To Live (TTL) settings by use of HTTP headers

•  Enable Honor-CacheControl and Honor-Expires

•  Make use of following headers – Edge-Control – Cache-Control – Expires

Page 18: CIRCUIT 2015 - Akamai:  Caching and Beyond

Control TTLs at Origin

•  Using Apache and mod_expires Edge-Control: cache-maxage=1h Cache-Control: no-store Expires: “now”

•  In the absence of Edge-Control header, Cache-Control: max-age=600 ExpiresByType “image/gif” “access plus 1 hour”

Page 19: CIRCUIT 2015 - Akamai:  Caching and Beyond

Use Zero-TTL for Time-sensitive content

•  Zero TTL (cache-maxage=0s) causes edge servers to contact origin for each request to ensure freshness

•  No-Store Header? •  If-Modified-Since requests are less

expensive than GET •  Edge-Control: cache-maxage=0s

Page 20: CIRCUIT 2015 - Akamai:  Caching and Beyond

Query String treatment

•  Ignore Query String •  Ignore Query Arguments

•  www.example.com/ getfile.asp?fileID=1234&randomKey=a1b2&sessionID=32Getfile.asp

•  Ignore Case in cache •  Include Query Strings

Page 21: CIRCUIT 2015 - Akamai:  Caching and Beyond

Error Response TTL (Negative TTL)

•  By default, negative responses from origin are cached for 10 seconds.

•  In practice, however 10 seconds error caching TTL is very low and can significantly increase the load on origin if you have recently migrated to a new site or have several bad links.

•  Experiment with TTL of 5-10 mins for error caching.

Page 22: CIRCUIT 2015 - Akamai:  Caching and Beyond

Edge Side Includes (ESI)

•  Edge Side Includes (ESI) make it possible for edge servers to assemble dynamic content.

•  Because the edge server performs the assembly, pages that otherwise would have been entirely uncacheable can now be partially cached at the edge, reducing bandwidth costs and eliminating the "least-common-denominator" cacheability problem.

Page 23: CIRCUIT 2015 - Akamai:  Caching and Beyond

Security

Page 24: CIRCUIT 2015 - Akamai:  Caching and Beyond

Why Security

•  Security is important, why? – Cyber attacks becoming common

•  According to FBI Director James Comey, “There are two kinds of big companies in the United States. There are those who’ve been hacked…and those who don’t know they’ve been hacked

•  Target, Home Depot, Google, Apple iCloud

Page 25: CIRCUIT 2015 - Akamai:  Caching and Beyond

Security is important, why??

•  Cost

•  A recent survey by the Ponemon Institute showed the average cost of cyber crime for U.S. retail stores more than doubled from 2013 to an annual average of $8.6 million per company in 2014

•  Web Application attacks cost these organizations on an average of 3.1 millions.

Page 26: CIRCUIT 2015 - Akamai:  Caching and Beyond

Security Cost breakdown..

Page 27: CIRCUIT 2015 - Akamai:  Caching and Beyond

What can you do about it

•  Web Application Firewall (WAF) – Most companies accept that WAF is an

effective and important tool in fighting the Web Application attacks, however

– Most organizations have not deployed their WAF in a manner that allows them to stop attacks

– Reason? •  WAFs require significant management overhead

as much as three or more FTE assigned just to properly manage WAF.

Page 28: CIRCUIT 2015 - Akamai:  Caching and Beyond

Manage WAF - Cost

Page 29: CIRCUIT 2015 - Akamai:  Caching and Beyond

Options…

•  Mod Security (Open Source) •  Cloudflare •  Incapsula •  Kona WAF by Akamai

Page 30: CIRCUIT 2015 - Akamai:  Caching and Beyond

How it helps!

Page 31: CIRCUIT 2015 - Akamai:  Caching and Beyond

Security features in Akamai

•  Application Layer Security – ModSecurity rule set – Akamai Kona Rule Set – Custom rules

•  Network Layer Controls •  Rate Controls •  Slow POST Protection

Page 32: CIRCUIT 2015 - Akamai:  Caching and Beyond

Kona Web Application Firewall by Akamai

•  Kona WAF provides always-on and highly-scalable protection against web application attacks including SQL injections, cross-site scripting, and remote file inclusion - while keeping the performance high.

•  It inspects every HTTP and HTTPS request, detecting and blocking threats to web applications before they reach the data center.

Page 33: CIRCUIT 2015 - Akamai:  Caching and Beyond

Mobile Optimization

Page 34: CIRCUIT 2015 - Akamai:  Caching and Beyond

Why Mobile Experience is important

Page 35: CIRCUIT 2015 - Akamai:  Caching and Beyond

World is going mobile but…

•  Challenges – Wireless network problems – Device limitations and inconsistencies – Constant rapid change

Page 36: CIRCUIT 2015 - Akamai:  Caching and Beyond

Can Akamai help?

•  Edge Caching •  Mobile Detection and Redirect •  Front End Optimization •  Adaptive Image Compression •  Enhanced Mobile Protocol

Page 37: CIRCUIT 2015 - Akamai:  Caching and Beyond

Mobile Redirects

Page 38: CIRCUIT 2015 - Akamai:  Caching and Beyond

Advantage of Edge redirects

Page 39: CIRCUIT 2015 - Akamai:  Caching and Beyond

Async JavaScript

Page 40: CIRCUIT 2015 - Akamai:  Caching and Beyond

Backend Latency

Page 41: CIRCUIT 2015 - Akamai:  Caching and Beyond

Q & A

Questions?

Email: [email protected]