Skip to content
Academy
Tutorials

2 min readbeginnerWritten walkthrough

CDN setup

From zero to globally cached in under 10 minutes. Create a CDN deployment, add your domain, configure caching rules and go live.

CoversCDN

Creating a CDN deployment#

A CDN deployment is a container for one or more domains. When you create one, Edge provisions cache space across 988 global edge locations for your content.

In the console, navigate to CDN and click Create Deployment. Give it a name that identifies your project (e.g. “marketing-site” or “api-cache”).

Adding a domain#

Each deployment can have multiple domains. Add your domain and specify the origin, which is the server where your content lives. Edge fetches from your origin on cache miss and serves from cache on hit.

You’ll need to create a CNAME record pointing your domain to cdn.edge.network. Once DNS propagates, Edge automatically provisions a free SSL certificate via Let’s Encrypt.

Configuring cache rules#

By default, Edge caches everything for 1 year. You can customise this per path:

  • Static assets (images, CSS, JS): cache for 1 year, as they rarely change.
  • HTML pages: cache for 1 hour or less if content updates frequently.
  • API responses: short TTL (minutes) or bypass the cache entirely.

Configure these in the deployment’s Configuration tab under Cache Rules.

Image optimisation#

Edge CDN includes automatic image optimisation. When enabled, images are converted to WebP or AVIF based on the visitor’s browser support, and resized on-the-fly via URL parameters. This is enabled by default on new deployments.

Purging the cache#

When you update content, you can purge individual URLs or the entire cache. Purges propagate globally within seconds.

Terminal
# Purge a specific URL
edge cdn purge <deployment-id> --url https://cdn.example.com/style.css

# Purge everything
edge cdn purge <deployment-id>