Edge Functions limits

This feature is in BETA.

Keep the following limitations in mind when working with Edge Functions.

# Operation limits

Edge functions have limits for their size and the amount of memory and execution time they can use:

  • Code size limit: 20 MB after compression

    This is the maximum edge function bundle size supported.

  • Memory per set of deployed edge functions: 512 MB

  • CPU execution time per request: 50 ms

    This tracks all time spent running your scripts. Execution time does not include time spent waiting for resources or responses.

  • Response header timeout: 40 s

# Invocation limits

The number of invocations allowed per month varies by team plan. Refer to the pricing page for details.

# Feature limitations

This beta release includes the following limitations.

  • If a site has Netlify’s Split Testing enabled, requests to that site will not execute edge functions.
  • If a site is using Netlify’s Custom Headers, including basic authentication headers, they will not apply to edge functions.
  • Unexpected collisions may occur if a site has multiple framework plugins generating edge functions as part of the build.
  • The rewrite(url) method cannot be used to rewrite to a path that is associated with an edge function or to explicitly execute additional edge functions. If an edge function is declared for the target path, the edge function will not execute and a 404 will be returned instead. This applies to target paths on the same site and across sites. To create a chain of edge functions, you should instead use multiple declarations to associate a single path with a series of edge functions.
  • The rewrite(url) method cannot be used to rewrite to other domains. To fetch content hosted on another Netlify site or an external site, use the fetch Web API.
  • If you use the Netlify CLI command netlify dev to run edge functions, the CLI will only use environment variable values set using the Netlify UI, CLI, or API. netlify dev will not use variables declared in a local .env file for edge functions. As a workaround, use the CLI to import environment variables from your .env file into Netlify before running netlify dev.

Learn more about the edge function processing order and caveats

Along with the above limitations, we recommend you review our docs on the declaration processing order and caveats to consider when you create edge functions.