EdgeWorkers

Learn how to execute JavaScript functions at the edge to optimize site performance and customize web experiences.

Get Started    

Use cases

The EdgeWorkers service makes it possible for you to deploy JavaScript functions at the edge and create customized experiences for your website visitors. Like most serverless solutions, EdgeWorkers scripts are invoked at the four different phases of an HTTP request. This provides an opportunity to improve performance, by moving compute closer to your users. Using every edge server as a compute node also accelerates your development and deployment times by applying solutions on a massive scale across our entire, globally distributed, Intelligent Edge Platform.

Follow these steps to implement a serverless function, written in JavaScript. To do this, you'll create an EdgeWorkers code bundle.

  1. Create an EdgeWorker ID.

  2. Create a main.js file.

    Here are recipes for the JavaScript source code that include event handler functions for some of the most common EdgeWorkers implementations.

Add geo and custom data as a cookie Boost search autocomplete performance Display pages based on location
  1. Create a bundle.json file that contains metadata for the EdgeWorkers function.

  2. Create a code bundle to compress the .main.js and bundle.json files into a .tgz file.
    tar -czvf filename.tgz main.js bundle.json

  3. Activate the version, see Manage EdgeWorkers.

  4. Use the EdgeWorkers CLI to update the results for the most popular search terms via a scheduled task.

👍

You can find more code samples in the EdgeWorkers GitHub repository. They are practical examples to use as a starting point for your ​Akamai​ EdgeWorkers. Feel free to use, modify, and extend!

Updated 19 days ago


Use cases


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.