+ All Categories
Home > Documents > Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and...

Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and...

Date post: 05-Jun-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
21
Transcript
Page 1: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content
Page 2: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Unlocking the Programmatic Edge for the Agile DeveloperUsing EdgeWorkers with Akamai Sandbox

Page 3: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

SpeakerDavid TheobaldPrincipal Product Architect, Web Performance Engineering

@Akamai 11 years and counting

Aka-SME for all things Edge Computing: EdgeWorkers, Cloudlets, ESI, Advanced Configuration

Based in tropical Des Moines, Iowa USA

Page 4: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Full Transparency Clause

This is a preview of capabilities coming later in 2019. The products in this talk are available now…their integration is on the near term horizon.

Page 5: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

EdgeWorkers: Unlocking the content delivery layer

Page 6: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Let’s Dig in…

Page 7: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

EdgeWorkers? Not EW!

EdgeWorkers is a new way to drive powerful web experiences, by enabling developers to run JavaScript at the Akamai Edge.

This intersection of serverless compute and content delivery provides the best of both worlds - performanceand productivity.

Page 8: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

EdgeWorkers FeaturesThe tech preview release, available now on Akamai Staging & Production* networks, offers…

Low-latency JavaScript engine built on V8 isolates to safely deploy event functions on every Akamai Edge

Read/Modify Cookies, headers, URI to build custom logic and optimize traffic

Create response bodies for quick Edge responses

Access to content targeting, and device characteristics to personalize logic

Build conditional logic using Property Manager Variables

* Fine print: customer must be leveraging Ion or DSA delivery products on Akamai’s Secure Networks; Production traffic will be contained by custom delivery maps during Tech Preview Phase (ie: not full network reach, yet)

This is just the beginning ... regular releases will build on this initial capability!

Page 9: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Intersection of serverless and CDN improves performance and productivity

Why Serverless + CDN ?

Faster application experiencesWith compute closer to your data, you can avoid unnecessary network hops.

Faster to productionIntegrate into your existing workflows enabling multiple teams to work in parallel.

Minimize ramp-up timeLeverage tools and skills your team already has, and avoid learning proprietary products.

Just codeAvoid the hassle of managing cloud resources, and building for scale.

Page 10: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

What can I do?

Use EdgeWorkers functions to solve challenging delivery problems such as…

Offload Improvement

Ability to manage and improve cache TTLs

A/B Testing

Enable controlled roll-outs of new services

URL Redirects

Redirect based on geo, device, and user-agent

Traffic Filtering

Block, redirect and provide responses based on conditional logic

Customized Responses

Customize error responses to improve web experiences, even when the origin is down

Load and Failover

Forward to different origins to balance request or react to failures

Debug logging

Add or remove debug information from the http message

Page 11: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Event Model

Like all serverless computing solutions, EdgeWorkers functions are event driven, allowing developers to run their code at specific events along the content delivery path.

Leverage any of the key delivery events:

1. On Client Request: for every request before checking cache 2. On Origin Request: if response not served from cache, before forwarding to origin 3. On Origin Response: when origin responds with content

4. On Client Response: for every request before response sent

Page 12: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Just Code!

EdgeWorkers offers a JavaScript specification that can be used to influence the delivery of responses to your end users Modern JavaScript syntax allows you to express CDN transformations more succinctly than ever before! Request and Response Objects provide access to HTTP and Akamai network data

function onClientRequest(request) {var requestUrl = request.url.toLowerCase();var cartCookie = (request.cookies.hasOwnProperty('cart')) ? request.cookies['cart'] : null;

if (requestUrl === '/api/cart-count' && !cartCookie) {request.respondWith(new Response(

200, {'Content-Type': ['application/json; charset=utf-8']}, '[]'));}}

function onClientResponse(request, response) {//Add custom trace header

response.headers['X-EdgeWorker'] = ['onClientResponse-'+request.variables['PMUSER_GHOST_IP']];}

Page 13: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

EdgeWorkers Demo

Page 14: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Welcome to Akamai’s tasty treats e-commerce site, MoFroYo.Co!

As Software Engineers @ MoFroYo, we are tasked today with solving some delivery problems to make our user’s experience extra sweet:

Improve the shopping cart response time when there are clearly no snacks yet in the cart

Reduce inbound traffic to the Content Origin for shopping cart count checks

Leverage a programming language familiar to our development team for easy debugging and maintenance Configure, code and test these changes in a way that does

not disturb production end users of MoFroYo or other team members

Page 15: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Code

Test

Configure

EdgeWorkers Akamai Sandbox

Isolated, Concurrent and Rapid iteration

(Serverless Computing @ the Edge) (Isolated Akamai Dev Stack)

Page 16: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

EdgeWorkers +

SandboxRequest Flow

Page 17: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Demo Task ListHere’s what we need to accomplish as Software Engineers @ MoFroYo.Co:

Spin up an Akamai Sandbox that clones the Ion delivery property for www.mofroyo.co, as well as any associated EdgeWorkers

Use JavaScript constructs and Akamai’s EdgeWorker specification to code the Traffic Filtering business logic for the Shopping Cart

Update Akamai Sandbox with new EdgeWorkers function(s) and test to validate the transformations achieve the intended result

Page 18: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Let’s Go!

Page 19: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

What’s Coming Next…2019 H2 2020 H1 H2 2021

Features for Production traffic

Support for Conditional Decisions and Additional Delivery Types

Support for Dynamic Decisions, API Orchestration, and Dynamic Content Assembly

Integration with Data Storage

Features Adds:

● Low-latency JavaScript engine

● Read/Modify Cookies, headers, URI

● Create response bodies

● Access to content targeting, and device characteristics

Adds:

● Debugging and trace tools

● Cache key features: set cache keys, change TTLs, change origin path, modify forward URL

● Support for Standard TLS-only network

Adds:

● Remote call interface

● Ability to read and modify response bodies

Adds:

● Edge data storage interfaces to optimize edge decisions

● Fast deployment and globally consistent within seconds

Use Cases Enables:

● URL Redirects

● Traffic Filtering

● Customized Responses

● Debug logging

Enables:

● A/B Testing

● Load and Failover

● Offload Improvement

Enables:

● Personalization Decisions

● Dynamic Content Assembly

● API Orchestration

● 3rd Party Integration

● Authorization Offload

Enables:

● Access Tokens and Authentication

● Redirect / Block lists

● Phase Release and A/B Testing

● Configuration Data

● Log data

● Shopping Cart

Page 20: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

MORE EdgeWorkers?Sign-up for the Tech Preview Learn more at: developer.akamai.com/edgeworkers

Get Hands-OnVisit the innovation zone for demos and deep dives!

Page 21: Unlocking the Programmatic - Akamai · Read/Modify Cookies, headers, URI to build custom logic and optimize traffic Create response bodies for quick Edge responses Access to content

Recommended