Skip to content

Examples

Refer to the following examples to get started creating your snippet code.

Refer to How it works and Create a snippet in the dashboard for overall guidance.

27 examples

Add HEX timestamp to a request header

Add a custom header to requests sent to the origin server with the current timestamp in hexadecimal format for debugging, tracking, or custom routing purposes.

Custom cache

Store, retrieve, and remove assets from cache programmatically. Use this template to optimize performance and implement custom caching strategies.

Debugging logs

Send debugging information in an errored response to a logging service.

Maintenance page

Serve a custom maintenance page instead of fetching content from the origin server or cache. Ideal for downtime notifications, planned maintenance, or emergency messages.

Set security headers

Set common security headers such as X-XSS-Protection, X-Frame-Options, and X-Content-Type-Options.

Sign requests

Verify a signed request using the HMAC and SHA-256 algorithms or return a 403.