All spotlights

Product spotlight · July 2025

Run edge functions before content, on a schedule and inside pages

Edge functions now run before content as auth functions, on a schedule, inside pages and as content filters, and you can deploy them from the CLI or a workflow.

Updated Edge functions For developers

What changed from April 2024 to July 2025

The July 2025, November 2024, September 2024, August 2024 and April 2024 changelogs have the full details.

  • Auth functions September 2024

    An auth function decides whether a request can proceed. Attach one to a rule with the Edge auth action, and it runs before content is served on the matched paths. It lets the request continue or returns its own response, such as a sign-in page.

  • Scheduled execution November 2024

    Run an edge function on a recurring schedule, from a preset or a cron expression. Each schedule sets the HTTP method and can send headers and payload data. A history view records each run with its status code and response body.

  • Content filters April 2024

    Content filters change a response before it reaches visitors, for example to rewrite markup. Run them with the Execute content filter rule action. From November 2024, they also apply to HTML pages that a proxy on 404 rule fetches from your origin.

  • Inline functions and location August 2024

    A {{QUANT_FN:UUID}} token in your page markup is replaced with the function's output when the page is served. Edge functions can also read the visitor's location from event.geo, such as the country, region and city.

  • Deploy from the CLI and CI November 2024

    Version 5 of the CLI was published only as the quantcdn/cli Docker image, not on npm. It adds function, filter and auth commands, and a functions command that deploys several from a JSON file. The functions input of deploy action v5 deploys them with your static assets.

  • Content filter rules in Terraform

    A new quant_rule_content_filter resource manages content filter rules in Terraform. Proxy, redirect, header and content filter rules now have a weight argument. Rules with a lower weight are evaluated first.

Action needed

  • Remove the attachments input from your workflow when you upgrade to version 5 of the deploy action.

Who it is for

  • Edge developers

    Run JavaScript on a schedule, read the visitor's location, and test a function in a live preview before you publish it.

  • Private content owners

    Attach an auth function to a rule, so that it checks each request before the content on the matched paths is served.

  • Platform teams

    Deploy functions, filters and auth functions from the CLI or a workflow, and manage content filter rules in Terraform.

What it does

Edge functions run JavaScript at the edge, in three types: edge functions build a response, auth functions decide whether a request can proceed, and content filters change a response. Page rules decide where each one runs, with the Execute serverless function, Edge auth and Execute content filter actions.

Edge functions launched in February 2024, and KV stores followed in September 2024. This post covers the changes from March 2024 to July 2025. In June 2025, the rules API added function and content-filter endpoints for edge function and content filter rules.

How it works

Add the function’s token to your markup:

{{QUANT_FN:UUID}}

For content served from Quant, turn on “Enable inline functions” in the project settings. For HTML responses from your origin, select “Allow inline functions” on a proxy rule. Since September 2024, if the function returns a Cache-Control header, the whole page uses that header. Without one, the page is sent as private and is not cached.

The event.geo object includes the country, region, city, postal code, latitude, longitude, and the network (AS) name and number. Use it to show a consent notice for the visitor’s country, or to send visitors to a local edition of your site.

The function editor has auth function examples for Apple sign-in, Auth0 and basic authentication, and from November 2024 for Azure AD, Facebook and GitHub.

Get started

  1. Open the functions page

    Find your functions, their URLs and their revisions on the Edge functions page.

  2. Test in live preview

    Run the function in the editor and check its output before you publish it.

  3. Protect a path

    Add a rule with the Edge auth action. Read Auth Middleware.

  4. Add a schedule

    Pick a preset or a cron expression. Read Scheduled Functions.

  5. Deploy from a workflow

    Give deploy action v5 a JSON file of your functions in its functions input.

Related: Explore Edge functions · Documentation · July 2025 changelog

Ready to try it on Quant?

Use edge functions on your own project, or read the docs first.