CDB EdgeCompute CDN applications run inside the CDN request pipeline and modify requests and responses before they reach the origin or client.
A CDN resource configured for the origin is required. To create one, follow the CDN resource guide.
How it works
The CDN runtime invokes a CDN application at five stages of the request lifecycle:
On request headers (before cache): when the CDN receives request headers, before the cache is checked.
On request headers (after cache): when the CDN receives request headers, after the cache is checked.
On request body: when the CDN receives the request body.
On response headers: before the CDN sends response headers to the client.
On response body: before the CDN sends the response body to the client.
ℹ️
CDN applications are built on the Proxy-Wasm specification — an open standard for WebAssembly-based proxy extensions.
⚠️
Only one CDB EdgeCompute application can be attached to each processing stage.
Step 1. Create a CDB EdgeCompute application
Deploy an application from a predefined template or upload a custom binary. Custom binaries must conform to the Proxy-Wasm specification.
A predefined template is available for JWT authentication. It verifies the JSON Web Token in the request Authorization header before the request reaches the origin.
Open the CDN Applications page and click Create new application.
Click Upload binary.
Select the compiled .wasm file.
Enter a name for the application and, optionally, a description.
Add any required environment variables as key-value pairs. For sensitive values, click + Add Secret to store them in Secrets Manager instead.
Click Save and deploy.
The application is deployed and ready to be linked to a CDN resource. To adjust the configuration later, click Actions > Edit application.
Step 2. Enable CDB EdgeCompute for your CDN resource
CDB EdgeCompute can be enabled for all requests on a CDN resource, or limited to specific URL paths using CDN rules.
In the Customer Portal, navigate to CDN.
Find the resource and open its settings.
Scroll to the CDB EdgeCompute apps section and enable the toggle for the required stage.
Select the application from the dropdown.
(Optional) Select the Interrupt request processing in case of error checkbox.
ℹ️
The Interrupt request processing in case of error checkbox is enabled by default. When active, errors on the CDB EdgeCompute side return the relevant response code to the client. When disabled, the CDN ignores the error and forwards the request to the origin. For security-sensitive applications, keep this checkbox enabled.
Click Save.
URL-specific rules apply CDB EdgeCompute logic only to certain paths — for example, protecting /api/ with JWT validation while leaving other paths unaffected.
In the Customer Portal, navigate to CDN.
Find the resource and open its settings.
Click Rules > Create rule.
Click Create blank rule.
Enter a rule name.
In the Match criteria section, specify the URL paths affected by the application.
In the Options section, click Add option.
Scroll to the CDB EdgeCompute apps section and enable the toggle for the required stage.
Select the application from the dropdown.
(Optional) Select the Interrupt request processing in case of error checkbox.
ℹ️
The Interrupt request processing in case of error checkbox is enabled by default. When active, errors on the CDB EdgeCompute side return the relevant response code to the client. When disabled, the CDN ignores the error and forwards the request to the origin.
Click Create rule.
Disconnect CDB EdgeCompute from CDN
To stop CDB EdgeCompute processing on a CDN resource, disable the configured toggles and save.
In the Customer Portal, navigate to CDN.
Find the resource and open its settings.
To disable CDB EdgeCompute for the whole CDN resource, disable the toggles in the CDB EdgeCompute apps section.
To disable CDB EdgeCompute for specific URL paths, open the Rules page and disable the toggle for the relevant rule.
Click Save changes.
Delete a CDN application
ℹ️
An enabled CDB EdgeCompute application linked to a CDN resource cannot be deleted. Disconnect it from the CDN resource first.
In the Customer Portal, navigate to CDB EdgeCompute.
Open the CDN Applications page and click the three-dot icon next to the application.
Click Delete.
Confirm by clicking Yes, delete.
CDB EdgeCompute CDN applications run inside the CDN request pipeline and modify requests and responses before they reach the origin or client.
A CDN resource configured for the origin is required. To create one, use the Create CDN resource API endpoint.
All requests authenticate with an API token. Set it as an environment variable before running the examples:
export GCORE_API_KEY="{YOUR_API_KEY}"
How it works
The CDN runtime invokes a CDN application at five stages of the request lifecycle:
on_request_headers: when the CDN receives request headers, before cache.
on_request_headers_after_cache: when the CDN receives request headers, after cache.
on_request_body: when the CDN receives the request body.
on_response_headers: before the CDN sends response headers to the client.
on_response_body: before the CDN sends the response body to the client.
ℹ️
CDN applications are built on the Proxy-Wasm specification — an open standard for WebAssembly-based proxy extensions.
⚠️
Only one CDB EdgeCompute application can be attached to each processing stage.
Step 1. Upload a binary
Upload the compiled .wasm file to the CDB EdgeCompute binary store. The API automatically detects the binary type from the file contents.
Step 3. Enable CDB EdgeCompute for your CDN resource
Update the CDN resource to route traffic through the CDB EdgeCompute application. The edgecompute option accepts five trigger stages — configure the ones the application handles.
Replace RESOURCE_ID with the CDN resource ID. The interrupt_on_error field controls behavior on error: true returns the CDB EdgeCompute error to the client, false forwards the request to the origin. For security-sensitive applications, set it to true.
An enabled CDB EdgeCompute application linked to a CDN resource cannot be deleted. Disable the CDB EdgeCompute integration on the CDN resource before deleting the application.