EdgeWorkers

Use EdgeWorkers to help optimize content delivery, by deploying JavaScript functions at the edge.

What is EdgeWorkers?

EdgeWorkers is a server-less solution that uses scripts that are invoked at the different phases of an HTTP request. This provides an opportunity to improve performance, by moving compute operations closer to your users.

Once you add EdgeWorkers to your property, developers can activate code outside of ​Akamai​ Control Center. Just activate custom scripts and efficiently implement enhancements. You can write functions that access HTTP headers, cookies, and URLs in order to construct complex logic.

So, if you want to implement Object Delivery enhancements, but don't have significant experience with Control Center or Property Manager, you can use EdgeWorkers.

Here are some more examples of how you can use EdgeWorkers:

  • Redirect requests based on geography, device, and user-agent
  • Apply conditional logic to filter traffic and construct responses
  • Add or remove debug information from an HTTP message
  • Respond with custom error responses, even when the origin is down

How to configure EdgeWorkers

There are some administrative tasks required to configure your Object Delivery property to execute EdgeWorkers functions:

  1. Add EdgeWorkers to your contract

  2. Add the EdgeWorkers behavior

  3. Create an EdgeWorker ID

Check out the "Hello World" tutorials to get started

We've put together some tutorials that show you how to get an EdgeWorkers function up and running on your site. You'll learn how to set up the EdgeWorkers service and then create and deploy the Hello World code bundle using the EdgeWorkers Management application, API, and CLI.

Known issues

Before you add EdgeWorkers support to your Object Delivery configuration, there are some known issues you should consider. We are working on fixes to these issues.

  • EdgeWorkers is not supported for use with Auth Token 2.0 Verification. An EdgeWorkers request for your Object Delivery property that also has Auth Token 2.0 Verification enabled is denied.

  • EdgeWorkers is not supported for use with the Cache HTTP Redirects behavior. After the Cache HTTP Redirects behavior applies a redirect, follow-up EdgeWorkers requests fail due to an error with origin-side event handlers.

  • The EdgeWorkers "failaction" is incompatible with the Site Failover behavior if it's Action is set to "Serve alternate content from NetStorage." You'll see a 400 response when an EdgeWorkers execution fails and the Site Failover behavior tries to fetch content from NetStorage as your alternate origin. If you need to incorporate Site Failover, you'll need to set the failover Action to something other than NetStorage.