Welcome! Edge Functions can be used with Next.js to modify cloud function responses at the edge.
The request workflow without Edge Functions is:
- The browser will request the page
/example
. - Edgio will match this request as defined in the
routes.ts
file and process it through Next.js as a cloud function. - The Next.js server will render the page and the response will be sent to the browser.
(go to
/example)
The request workflow with Edge Functions is:
- The browser will request the page
/example?edge=1
. - Edgio will match this request as defined in the
routes.ts
file and process it through./edge-functions/index.js
. - The edge function will issue a fetch request to the
edgio_serverless
origin, forwarding the original request to the Next.js cloud function. - The Next.js server will render the page and respond to the edge function.
- The edge function will modify the response, replacing
Edgio Cloud Functions
withEdgio Edge Functions
, and send it to the browser.
(go to
/example?edge=1)