A distribution’s settings are on three pages, one for each tab of its details: the basic settings, the origin, and the cache behaviour. Each change is served within seconds. State can take up to about 15 minutes to read Deployed.
To open a distribution’s details, go to MyAccount, under Network, click CDN, and click the distribution on Manage CDN Services. Its details open below the list in six tabs. The first distribution is selected when the page opens.
Before you begin
Section titled “Before you begin”You need a distribution; see Create a distribution or Serve a bucket through the CDN.
A distribution has one origin and one cache behaviour, and you can change the settings of both. To use a different origin, create a new distribution; see Create a distribution.
Change the basic settings
Section titled “Change the basic settings”Basic Details shows the distribution’s Distribution ID, Root object (/ when none is
set), Distribution Domain URL, Distribution State, Supported HTTP Versions,
Distribution Status, Security Policy, Created On (IST), Domain name, and
Modified On (IST). The Distribution ID names the distribution in the API.
- On Basic Details, click Edit. Edit Basic Distribution Settings opens. Domain Name shows the origin, which stays as it is.
- In Supported HTTP Versions, choose the versions visitors can use:
- HTTP/2, HTTP/1.1, HTTP/1.0, the default, lets browsers that support HTTP/2 use it, which usually loads pages faster, so keep this default.
- HTTP/1.1, HTTP/1.0 turns HTTP/2 off.
- (Optional) In Default Root object, enter the file to return when a visitor asks for the root
address,
https://<distribution-url>/, such as index.html. Enter a file name with an extension and no leading/. Use letters, digits, underscores, dots, hyphens, round brackets, and the at sign; anything else reads Please put valid object name. On a bucket’s distribution, the file takes the place of the bucket’s file list at the root address. - Click Save.
Change the origin settings
Section titled “Change the origin settings”Origin Detail shows the origin’s settings. The connection timeout is labelled Origin Keepalive Timeout there, and Origin Connection Timeout on the edit page.
- On Origin Detail, click Edit. Edit Origin Settings opens. Origin Domain Name and Origin ID stay as they are.
- (Optional) In Origin path, change the folder at the origin to serve from, such as
/static, or clear it to serve everything. Start it with/, and leave no/at the end. - Choose the settings, and click Save.
How the CDN connects to your origin
Section titled “How the CDN connects to your origin”Origin Protocol Policy sets how the CDN connects to your origin:
- HTTPS only, the default: the CDN always uses HTTPS. Your origin needs a certificate that is valid for its domain name; without one, visitors get an HTTP 502 error.
- HTTP only: the CDN always uses HTTP. Choose this for an origin that serves only HTTP.
- Match Viewer: the CDN uses whichever the visitor used.
Origin SSL Protocol is the oldest TLS version the CDN accepts from your origin over HTTPS: TLSv1.2, the default, or TLSv1.1. Choose the newest your origin supports.
Timeouts
Section titled “Timeouts”- Origin Response Timeout is how long the CDN waits for your origin to answer: 4 to 60 seconds, 30 to start. If visitors get timeout errors, first find out why your origin is slow to answer; raise the timeout only if the origin needs the time.
- Origin Connection Timeout is how long the CDN keeps an idle connection to your origin open, so the next request can reuse it: 1 to 60 seconds, 5 to start. It helps only if your origin keeps connections open too.
A value outside the range reads Please enter time between 4 to 60 seconds or Please enter time between 1 to 60 seconds, and anything that is not a number reads Please enter value in number only.
Change the cache behaviour
Section titled “Change the cache behaviour”Cache Behaviour shows Viewer Protocol Policy, Allowed HTTP Methods, Minimum TTL, and Maximum TTL.
- On Cache Behaviour, click Edit. Edit Cache Behaviour opens. It also has Default TTL.
- Choose the settings, and click Save.
How visitors connect
Section titled “How visitors connect”Viewer Protocol Policy sets how visitors connect to the distribution:
- HTTPS Only, the default: visitors connect over HTTPS.
- Redirect HTTP to HTTPS: a visitor who uses
http://is sent to thehttps://address. Choose this when people or old links usehttp://addresses. - HTTP and HTTPS: visitors can use either.
Which requests reach your origin
Section titled “Which requests reach your origin”Allowed HTTP Method sets which requests the CDN passes to your origin:
- GET, HEAD, the default, for files that visitors only read.
- GET, HEAD, OPTIONS, when browsers ask your origin which requests it accepts, as they do for some requests from other sites.
- GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE, when visitors also send data to your origin through the distribution.
Only answers to GET and HEAD requests, and OPTIONS requests when allowed, are cached.
How long files stay cached
Section titled “How long files stay cached”The three TTLs are in seconds, each from 0 to 3153000, which is about 36 days. Anything else reads Please enter time between 0 to 3153000.
- Default TTL, 86400 seconds (one day) to start, is how long a file stays cached when your
origin sends no caching headers:
Cache-Control: max-age,s-maxage, orExpires. - Minimum TTL, 0 to start, and Maximum TTL, 3153000 to start, set the shortest and longest time a file stays cached when your origin does send those headers.
Choose a shorter TTL for files you change often, and a longer one for files that rarely change, such as images with a version in their names.
The CDN caches by the file’s path. Query strings and cookies are not passed to your origin, so
/images/logo.png?v=2 gets the same cached file as /images/logo.png. The CDN passes four request
headers to your origin, Accept, Access-Control-Allow-Origin, Content-Type, and Origin, and
caches a separate copy for each value they carry. The CDN serves files as your origin sends them;
to serve compressed files, compress them at your origin.
Check that the change is deployed
Section titled “Check that the change is deployed”After Save on any of the three pages, you see Your Distribution has been updated successfully. It will take upto 30 minutes to deploy the new changes. Please wait. and return to Manage CDN Services. State reads InProgress until the change is deployed, then Deployed. The distribution serves the change within seconds, while State can still read InProgress for up to about 15 minutes.
If a settings page refuses the change, the error opens in a dialog with E2E’s message.
The distribution now serves files with the new settings. To replace files already cached, see Clear the cache. For help with any message, see Troubleshooting CDN.