Zum Inhalt springen

CDN features and options

Zuletzt aktualisiert am

This document details the core features and configurations available within the STACKIT Content Delivery Network (CDN).

The following table outlines which STACKIT CDN features are currently available and which are still being developed:

The origin is the definitive source of your content. The STACKIT CDN fetches resources from the origin when they are not in the edge cache or when edge delivery rules exclude them.

There are two backend types available:

  • HTTP backend: Connects to any publicly accessible web server via a URL or IP.
  • Bucket backend: Specifically designed for S3-compatible storage. It allows the CDN to use stored credentials (access key ID and secret key) to fetch private assets securely.

Every CDN distribution automatically receives a managed STACKIT subdomain. To use your own branding, you can configure custom domains alongside of the managed domain.

By default, STACKIT assigns a subdomain to your distribution as the primary entry point for your website. This domain follows the format: {uid}.{internal-dns-zone}.cdn.onstackit.cloud

You can map your own domain (for example, shop.example.com) to a distribution. You can also link multiple custom domains to a single distribution.

To set up a custom domain:

  1. Create a DNS CNAME record that points your domain to the managed STACKIT CDN domain.
  2. Wait for the DNS record to propagate globally.
  3. Add the custom domain to your distribution configuration.

If you are migrating a domain currently in production, use the skipDnsCheck flag during setup. This allows STACKIT to provision SSL certificates before you switch your DNS records, preventing service interruptions.

All domains require SSL/TLS certificates for security. STACKIT provides two management options:

  • Managed certificates: By default, STACKIT provisions and automatically renews Let’s Encrypt certificates for your managed domains. You can enable this feature for custom domains to automate the certificate lifecycle.
  • Custom certificates: For specific compliance requirements, you can upload your own PEM-encoded certificates and private keys. These certificates are unmanaged, meaning you must rotate them manually. STACKIT does not send notifications before they expire.

By default, only TLS 1.2 and 1.3 are active to ensure a high level of security for your distribution. Support for the older, deprecated versions (TLS 1.0 and 1.1) is disabled out-of-the-box and must be explicitly enabled in your configuration if your specific client requirements demand it.

To help control costs and prevent unexpected traffic spikes from exceeding your budget, you can set a monthly bandwidth limit.

  • Configuration: Define the maximum amount of bandwidth in bytes (monthlyLimitBytes) that the distribution is allowed to consume within a single calendar month.
  • Limit enforcement: Once the monthly data or request limit is reached, the distribution automatically suspends service and serves an error page to all requesters until the next billing cycle begins or the limit is manually increased. During this suspension, the CDN stops forwarding all traffic to your origin.

Edge delivery rules allow you to manipulate how traffic is handled at the edge before it reaches the user or your origin.

By default, the CDN forwards all incoming request headers directly to your origin.

You can configure how the Host header is handled using the forwardHostHeader feature. Enabling this feature allows the original client Host header to be passed through to the origin.

When a request routes through the CDN, the system automatically appends the following headers to provide contextual information about the client and the edge server processing the request:

To optimize caching and request handling, the CDN drops the following headers before forwarding the request to your origin:

  • If-Modified-Since
  • If-Unmodified-Since
  • If-None-Match
  • If-Match
  • Range
  • If-Range

To identify traffic sources and manage backend communication, you can configure custom headers that the CDN includes in every request sent to your origin. This is particularly useful for identifying traffic coming specifically from the CDN or providing basic authentication tokens required by your backend. However, because these headers are stored as plain text, you should avoid using them for high-stakes secrets.

When the CDN returns a response to the client, it includes several headers detailing the cache status, edge server information, and response metadata.

Standard HTTP response headers (such as Cache-Control or Content-Type) can potentially be cached from your origin server. Conversely, headers prefixed with Cdn- are generated and appended exclusively by the CDN itself.

To increase security or ensure that sensitive session data is not leaked via the CDN, you can enable the stripResponseCookies flag.

When enabled, the CDN intercepts the response from your origin and removes all Set-Cookie headers before the response is forwarded to the end user. This is particularly useful for distributions serving purely static content where origin-level cookies are not required by the client.

Control access to your content based on user geographic location.

Force users to new locations using standard HTTP status codes.

  • Supported codes: 301 (Permanent), 302 (Found), 307 (Temporary), or 308 (Permanent).
  • Matchers: Rules use glob patterns (e.g., /shop/*) to trigger redirects based on the request path.

The STACKIT CDN accelerates content delivery by storing copies of your assets in edge locations across your selected regions (EU, US, AF, SA, ASIA). This reduces latency and minimizes the load on your origin server.

The time to live (TTL) determines how long an asset remains in the CDN cache before it is considered stale and must be fetched again from your origin.

  • Origin headers: By default, the CDN respects cache-control headers sent by your origin server.
  • Custom default TTL: If your origin does not provide a cache-control header, the CDN applies the default cache duration defined in your distribution configuration.

When you update content at your origin, the CDN may still serve the older version until the TTL expires. To force the CDN to fetch the latest version immediately, you must perform a manual purge.

There are different purge strategies available:

  • Full purge: Invalidates the entire cache for the distribution. While effective, a full purge for a large website can cause a “cache stampede,” where a massive volume of simultaneous requests hits your origin server to repopulate the cache.
  • Granular (Path-based) Purge: Invalidates only a specific path (e.g., /static/styles.css). This is the recommended approach for most updates, as it maintains the cache for unaffected assets and reduces the load on your origin.

To optimize your caching strategy, use the logging tools of STACKIT CDN to identify which assets are served from cache versus those causing origin pressure.

The Image Optimizer is a feature designed to dynamically enhance your media assets at the edge.

It provides real-time, on-the-fly image manipulation and optimization. By automatically compressing, resizing, and formatting your images before they reach the end user, the Image Optimizer ensures faster image delivery, drastically reducing bandwidth consumption and improving overall page load times.

STACKIT CDN provides logging and monitoring tools to help you analyze traffic, investigate security events, and optimize performance. You can access this data through the STACKIT interfaces or by streaming it to an external destination.

By default, STACKIT CDN stores the 10.000 most recent log entries from the past hour. You can query these logs directly via the API to perform quick troubleshooting or traffic analysis. A log entry contains the following information:

If you require retention longer than one hour or need to store more than 10.000 entries, configure a log sink. A log sink exports your logs to an external observability platform in real time.

Currently, STACKIT CDN supports Grafana Loki as a log sink destination.

Depending on the traffic your distribution receives, the volume of log data can grow rapidly. Ensure your external logging infrastructure is scaled to handle the expected ingestion rate and storage requirements.

In addition to granular logs, STACKIT CDN provides high-level metrics to monitor the health and efficiency of your distribution.

  • Cache hit ratio: Cache Hit Ratio: The percentage of requests served from the edge cache versus the origin. Aim for 80%-95%+ for static sites. A low ratio often suggests restrictive cache-control headers or excessive cache purging.
  • Total usage: The total traffic volume (in bytes) processed by your distribution. Use this to monitor bandwidth consumption and forecast costs.
  • Regional breakdown: Usage segmented by geographic region (e.g., EU, US, ASIA). This helps identify the location of your audience to optimize regional settings.