What is EdgeControl?


EdgeControl lets you run custom JavaScript logic at the CDN edge so you can control how requests and responses behave without changing your origin application.

Use EdgeControl for lightweight request and response logic such as header changes, URL/path rewrites, access control, geo-routing, CORS handling, and returning simple responses directly from the edge.


1. Access EdgeControl

Once EdgeControl is enabled for your account, you can access it from the service configuration area in the CacheFly portal.

  1. Log in to the CacheFly portal.

  2. Go to Configuration > Services.

  3. Click the service you want to configure.

  4. In the left-side menu, select Edge Control.

If you do not see Edge Control after it has been enabled, contact your CacheFly representative or open a support ticket.

* Edge Control appears in the left-side menu for the selected service.

2. Create your first script

On the Edge Control page, choose the Request or Response tab depending on where you want the logic to run. If there is no existing script, the editor will open as a draft and you can start writing directly in the script editor.

A basic script uses a handler function and returns the request or response after any logic is applied.

function handler(request) 
{ return request; 
}

Use Save to save draft changes. Before publishing, check the validation message below the editor for errors.

* The script editor opens a draft including Request and Response tabs, Save, Publish, and Version History.

3. Edit an existing script or create a new version

Published versions cannot be edited directly.

To make changes, create a new version from the Version History panel.

Click New on the right side of the EdgeControl screen and choose one of the following options:

  • From Default: starts a new version from the default script.

  • From Selected: starts a new version using the currently selected version as the starting point.

  • From Upload: allows you to upload a script file as the new version.

* Use the New menu in Version History to start a new version from default, selected, or uploaded script content.

4. Confirm how the script is attached

EdgeControl scripts are created inside a specific service. Once a script is created under that service, it is automatically connected to that service and its associated domains.

Important: There is no separate attach step. Before activating a script, confirm you are in the correct service and that the script should apply to the domains connected to that service.

5. Publish and activate your script

When you are done editing, click Save to save a Draft version or Publish.

To cancel the changes alltogether, click Cancel.

For Publish, you will then choose how you want to publish the new version.

  • Publish: publishes the new version, but does not make it active yet.

  • Publish and Activate: publishes the new version and immediately makes it active on the service.

  • Cancel: returns you to the editor without publishing.

Once a version is published, you will not be able to edit that version afterward. To make changes later, create a new version.

* The editor shows the current draft, Publish button, and Version History.

* The publish confirmation lets you choose Publish, Publish and Activate, or Cancel.

6. Test safely

The safest way to test EdgeControl is on a service designated for testing, such as a test or development service.

7. Disable EdgeControl if needed

* Use Deactivate to turn off the active EdgeControl script for the service.

8. Error behavior during beta


During beta, if an EdgeControl script errors or times out, request processing continues as if the script does not exist. This keeps traffic flowing through the normal CDN processing path while you test.

CacheFly may add additional error-handling options in the future, including per-service controls for whether processing should continue or the request should terminate.

9. Beta limits

During beta, script size and invocation limits are being evaluated.

Keep scripts lightweight and focused on CDN request/response behavior. CacheFly may adjust limits as beta feedback is collected and the system is benchmarked.

10. Support

If something breaks or you need help, open a CacheFly support ticket ( available in the Portal ) or contact your CacheFly representative.

To help us troubleshoot quickly, include the service name, script version, example URL or request, expected behavior, actual behavior, and approximate time the issue occurred.