About the JavaScript API
Review these details when designing EdgeWorkers functions. To learn more about the specific HTTP events that can execute an EdgeWorkers script, see Event handler functions.
For information about the supported HTTP methods see, Event handler methods.
Event Handler Function Support Matrix
View this event handler support matrix for information about the EdgeWorkers JavaScript objects, attributes, and functions each event type supports.
Event Handler | Use Cases | Methods |
---|---|---|
onClientRequest | Redirect Management
Traffic Filtering | respondWith() |
Header Management | getHeader() | |
Cookie Management | cookies toHeader() See the note below. | |
Delivery Property Flow Control | getVariable() | |
Conditionally Route Traffic
Personalization | route() | |
Cache Key Manipulation | excludeQueryString() includeQueryString() | |
onClientResponse | Redirect Management
Immediate HTML responses Refer to the Product limits for information about the supported response size. | respondWith() |
onOriginRequest
onOriginResponse | Header Management | getHeader() |
Cookie Management | cookies toHeader() See the note below. | |
Delivery Property Flow Control | getVariable() | |
responseProvider | Response Orchestration | httpRequest() text() To use the |
Manipulate the response (body, headers) | createResponse() |
Cookie Management methods
To use theCookie Management methods, you need to import the cookies module.
Updated 7 days ago