Script Management

Script Management is a suite of tools to help you minimize performance degradation from third-party JavaScripts that may be operating on your site or app.

How it works

It uses real-user monitoring (RUM) data gathered by ​Akamai​' mPulse service to show you which scripts referenced on your site are causing the largest impacts on performance. You can use this information to create Script Management policies that automatically block or defer scripts and ensure that single points of failure don't stop pages from loading. It also offers "testing suggestions" that help you find the most popular pages that your policy affects, so you can confirm that Script Management is working as intended.

The akam-sw.js service worker

As an end user requests a page on your site, Script Management installs a JavaScript service worker called akam-sw.js. A service worker is a code that runs in the background and performs tasks separate from the page and user interactions. Here's roughly how it works:

  1. With the Script Management enabled and its Mode set to Analysis and action, your Ion property injects a script into pages on your site.

  2. When a user first requests a page, the injected script downloads and installs the akam-sw.js service worker.

  3. The service worker applies your Script Management policy to manage scripts as the user navigates the page. (You create the policy outside of this behavior, using a separate tool.)

  4. As the user navigates your site, scripts are blocked, deferred, or allowed based on what's set in your Script Management policy.

Script Management doesn't conflict with other JavaScript service workers you may have on your site. The akam-sw.js service worker operates at the root scope of your site. This is true regardless of what page a user is viewing. For example, when a user requests www.example.com/products/widgets/index.html, the scope is www.example.com.

📘

The service worker only works with supported browsers. This currently includes the latest versions of:

  • Chrome (desktop and mobile)
  • Firefox (desktop and mobile)
  • Safari (desktop only)

Set up Script Management

Script Management is supported for use with ​Akamai​'s Ion product. You need to include a few other behaviors in your Ion property, too. We offer a workflow that describes the full process to add it in the Ion user docs.