Custom CDN Integration
The NativeWaves origin can be used with conventional HTTP based Content Distribution Networks (CDNs) if they meet the requirements. Common CDN providers like Amazon CloudFront, Akamai CDN, Microsoft Azure CDN are supported and tested.
- The CDN MUST support HTTP2.
- The CDN MUST support chunked transfer encoding.
- The CDN MUST respect the cache control headers set by the origin. It MUST NOT override them, otherwise this can lead to undesirable caching behaviour that causes scalability problems and adds more cost than necessary.
- The query parameters in the request URL MUST be forwarded to the origin as configured in the settings below, as this is a requirement for low-latency streaming.
- The CORS configuration as specified below (allow OPTIONS and forward certain header) is also required for streaming in browsers or similar.
- Http version: http2 # this is important because http 1.1 is not supported for low latency streaming
- Allowed HTTP methods: ["GET", "HEAD", "OPTIONS"]
- Viewer protocol policy: https-only
- Compress: false # compression can be disabled because all relevant origin requests are already compressed
- Forward Values:
- Forward all query strings
- Forward following headers:
- Accept-Encoding
- Cache policy:
- All forwarding values must be included in the cache policy whitelist, as otherwise incorrect responses would be returned to subsequent requests
To integrate the NW origin, you must first setup an origin gateway and generate an access key. These steps can be completed within the NW console or may be provided to you by NW operators as part of the initial setup process.
There are three options to integrate the origin based on your origin security settings:
Example Values:
- {originDomainName}: origin-xxxxxxxxxxxxxxx-cf.cdn.nativewaves.com
- {originAccessKeySecret}: 762c412a7524992dd57a86d01678878ef55e34ead72b8472e85ec015c7586836173ef25cecae96e28719a81ad777f6759bc59e1915c22aceb7678791345220a8
This is the recommended approach if the CDN supports header insertion.
- DomainName: {originDomainName}
- ConnectionAttempts: 3
- ConnectionTimeout: 10
- CustomOriginConfig:
- OriginProtocolPolicy: http or https
- OriginCustomHeaders:
- HeaderName: x-nw-origin-access-key
- HeaderValue: {originAccessKeySecret}
- DomainName: {originDomainName}
- OriginPath: /s/{originAccessKeySecret}
- ConnectionAttempts: 3
- ConnectionTimeout: 10
- CustomOriginConfig:
- OriginProtocolPolicy: http or https
The origin can be configured with public access. However, this is not recommended as this may allow someone to bypass the CDN's authentication mechanism and access the content directly from the origin.
- DomainName: {originDomainName}
- ConnectionAttempts: 3
- ConnectionTimeout: 10
- CustomOriginConfig:
- OriginProtocolPolicy: http or https
Once you've configured the CDN following the instructions provided, initiate a test by dispatching an HTTP GET request to the specified path (substitute "your-custom.cdn.com" with your actual CDN domain name):
If successful, you will receive an HTTP 200 OK response indicating, "Content Origin API successfully accessed via origin gateway 'xxxxxxxxxxxx'."