Add / Edit CDN Site

Plain HTML / Printer friendly.Plain HTML / Printer friendly.

A CDN site is a repository of resources and usually entered using a uniform resource locator, or URL. These can only be static content, such as CSS (Cascading Style Sheets), images, or Javascript.

Step One - Hostname and CDN Operator setup

There is an option here to be able to add multiple origins line by line. Similar in operation to adding just a single origin but it adds multiple origins to a single CDN hostname.

Select operator

Select one or more operators.

Enter CDN Hostname

This is the URL in fully qualified form without the prefix (e.g. https://, http://). Example can be cdn.mysite.com

Select CDN Type

Depending on the operator permissions, CDN types can be selected here. Note that if the type of CDN Push is selected, an origin is not needed.

Enter CDN Hostname

This is the hostname that is will serve content from the origin below, via the CDN set by the Operator.

Enable Pseudo Streaming

Enabling this option will allow for the CDN site to support content pseudo streaming.

Enter Origin

Originating server where the sites are loaded. Simply put, the originating hostname or IP address before the CDN came along, without prefixes (e.g. https://, http://). Example is mysite.com

 


Step Two - Content Restriction

Contains restricted content

Certain sites published may contain content not suitable to certain visitors and users, or may be prohibited by governmental laws. Check or tick this box if so.

Blocked countries

Select the geographical countries that are not permitted by legislation, embargo, or law to be viewed in.

Blocked IP addresses

Internet Protocol (IP) to block. This is for further granularity from blocking by country above.

Non-Cacheable Path

Nginx No-Cacheable Paths provides the capability to specify paths in CDN site that doesn't want edge servers to cache. Normally (and preferably) this can be done using htaccess at the origin, however with this feature it will be made configurable on the edge server too. Customers who do not have control over the origin or do not want to modify their origin configuration will then be able to specify which paths they want to disable caching for.

Note that the regex does not match against the query string, so a regex is unavailable that matches against the word “xxx” in http://cdn.example.com/search?query=xxx )

 


Step Three - Content Protection

 

Hotlinking protection

Protects direct linking to images and media. Sets to fully block or allow. If there is already a custom solution, or do not want it, leave it at its default "Disabled" option.

File extensions to protect 

Specify the particular file types by their extensions, separated by a single space between (e.g. .jpg .gif .swf).

Custom 403 Error Page

Contents that were blocked, if attempted to access, will lead site visitors to an Error 403 page. This complete web page will need to be written by a webmaster or web designer, and the URL to it has to be complete, right down to the page level (e.g. http://www.test.com/errors/403.php).

Password protection

Assign a list, of the user names and passwords allowed to access this site. They are strictly in the format of username:password, and the list is separated by a line.

The content of an invalid password error page can also be edited here.

Enable URL signing

Enabling this option provides an entry field to enter a secret key to securely sign any direct URI (Uniform Resource Indicator) link to all files/resources under this URL.

The secret key is similar to a password and can contain a minimum of 6 to a maximum of 32 characters. Symbols and spaces are allowed.

For generating the harsh key, kindly refer to generate hash link help document.

 


Step Four - Content Partitioning

Enable Content Partitioning

DNS Content Partitioning aims to improve the cache hit ratio and performance of HTTP pull sites. DNS content partitioning requires changes to both the publisher’s CNAME and publisher’s HTML code. It is suitable for content libraries which have a large number of files.

Currently, Aflexi edge servers are all independent, for example, edge servers don’t share their caches. When a request comes in for a URL, the Aflexi DNS redirector sends it to any server in the closest location. Although there may be two or more servers within the same location, the DNS Redirector may send a request for one object to two different servers. The second request could be served from cache if it was redirected to the same server as the first.

Conceptually, DNS Content Partitioning improves on this by adding extra context to the DNS request so that it can be redirected to the same server each time.

Publisher is given ten partition IDs, and need to bucket this contents into these partition IDs. For example, video ids 10, 20, 30 go into partition 0, video ids 19, 49, 89 go into partition 3. The CDN site used will be:

<1 to 10>.p.cdn.example.com CNAME to <1 to 10>.p.<CDN site ID>.r.afxcdn.net

When the DNS redirector gets a request for a particular partition+resource combination, it builds a ring based on consistent hashing or alternatively using a simple round-robin method. Then it selects a server from this ring. If the server is busy, it moves on to select the next server in the ring. Up to 3 servers will be selected, depending on the size of the location.

For example, if there are servers A, B and C, the selected server sequence could be:

Partition 0 = A, C, B

Partition 1 = B, A, C

..

Partition 9 = B, C, A

From the previous example, video id 10 will have the url http://0.p.cdn.example.com/10.mp4 . When presented this URL, the DNS redirector considers directing the request to server A first. If server A is busy, then direct it to server B. For video id 19 with url http://9.p.cdn.example.com/19.mp4 , server B would be considered first. Contrast this to the situation without partitioning - the DNS server would direct the request to any random server.

With the consistent hashing method, new servers can be added or removed without impacting the cache of existing partitions. However, it can produce imbalanced server selections due to its pseudo-random nature. Round-robin produces a very balanced server selection, however it can be unstable when new servers are added.

Alternative CDN Hostnames

Publisher is capable of adding several CDN hostnames with the same origin. Publisher can take advantage of parallel download to speed up page loading speed.

Fill in the alternative CDN URL in the advanced setting after CNAME to URL as provided in the instruction.

 


Step Five - Setup completion

  • Just a simple confirmation that ensures proper adding of the CDN site. If not agreeable or if there are amendments to be made prior, click Cancel.