Pull Zones: CDN

 

Description

Pull Zones accelerate the distribution of static files. From this page you can view, add, edit and delete Pull Zones. For CDN to serve traffic, a minimum of one zone must be created. Each zone can be uniquely configured.

Contents

Adding a Pull Zone

Perform the following steps while logged into the CDN Control Panel to add a Pull Zone:

  • In the menu bar, under "Manage Zones", select "Pull Zones".
    The Pull Zones page is displayed. 



  • Click the "Add" button.
    Choose one of the following 5 types:



    Pull Zones

    • Site Acceleration: Select this zone type to cache a preset list of files ( <500mb ) from your website and serve it from the platform.
      • File types include:   css, js, jpg, jpeg, gif, ico, png, bmp, pict, csv, doc, pdf, pls, ppt, tif, tiff, eps, ejs, swf, midi, mid, ttf, eot, woff, otf, svg, svgz, webp, docx, xlsx, xls, pptx, ps, class, jar
    • Small files: Select this zone type to cache small (< 10mb) static content (Images, CSS, JavaScript) from your website and serve it from the platform. It is not recommended to select this this zone for large content (> 10mb), dynamic content or media streaming.
    • Large files: Select this zone type to cache large (> 10mb) static content (Software updates, File archives) from your website and serve it from the platform. It is not recommended to select this this zone for dynamic content or media streaming.
    • Video On Demand: Select this zone type to distribute video files that have been pre-recorded. The VoD Zone supports both pseudo streaming (seek to not-yet-downloaded portions of a video) for FLV and MP4 files, and Adaptive streaming (HLS).
    • Live Streaming: Select this zone type to distribute an HLS Live Stream. As the playlist file for HLS (m3u8) is dynamically generated for a Live Stream, the playlist file is only cached for a minimal time on the platform.
  • Each of the 5 zone types have basic settings for which you need to enter values and click the "Save" button. 



    Field NameDescription
    StatusCDN Zone can be Activate or Inactivate. The zone needs to be activated in order to serve traffic.
    TargetThe Target is the CDN Domain where the CNAME points to. The URL is calculated from your CNAME value.
    CNAME

    A CNAME, or Canonical Name record, is an entry within the Domain Name System (DNS) that specifies where a user can find your web pages. A CNAME is required to associate your domain with your CDN service.
    For example, you first create a CDN Zone and then create a DNS record for your domain (e.g. static.example.com) and point it to the CDN Domain of your zone (e.g. a2a23913007f60933db72f23f7462584.lswcdn.net). 

    Origin

    Defines the URL (HTTP) of the customer’s source, on domain level.
    Example: http://source.example.com
    Content will be pulled from the customer’s origin and cached on the LeaseWeb CDN network when it is served to end-user for the first time. A request for http://static.example.com/file.jpg will be fetched from http://source.example.com/file.jpg and cached on the platform.

    The sub path is appended to the origin URL when fetching files for this zone. For example, with the following configuration:

    Origin: http://source.example.com
    Sub path: sub/path/

    A request for http://static.example.com/file.jpg will be fetched from http://source.example.com/sub/path/file.jpg.

  • Click the "Save" button.

Advanced settings for adding a Pull Zone

When adding a Pull Zone, you need to set the following advanced settings:

Alias domain

Sets an CNAME alias. An Alias can be used to have more than one name to point to the host.


Cache settings

Cache-control header

Defines the cache-control header that is served. By default, the cache-control headers are inherited from the origin.


The content is cached on your browser. If website content changes frequently, set a lower value. The options you can select are explained below:

- Inherit from origin (disabled): The CDN platform will not modify the cache headers, but will provide the cache headers that are provided by the origin server.

- No caching: Your browser will not cache the data.

- Re-validate: Your browser will request the CDN platform to verify if the content has changed. If yes, the CDN platform provides the updated file to the browser. If not, the browser cache is used.

- <select any time period>: Your browser will cache the data based on the time that you set.

404 response caching

Defines the time in seconds the 'Not found' (404) responses are cached for. The default value is 5 seconds.

This setting is only available for the Site Acceleration pull zone type. When enabled it will configure the zone to cache all object types including HTML web pages. Please note that depending on your zone and origin setup enabling this option can pose the privacy risks. For example, if your origin supports site management web interface (e.g. a CMS system) with cookie based logins and you enable 'Cache all objects' and 'Ignore cookies' then the management pages with sensitive information will probably get cached. This is just one example, there other types of setup that can leak private information.

Headers settings

Add HTTP Headers

Specify which HTTP headers you want to add to the HTTP request.

Examples:

  • Access-Control-Allow-Origin: *
  • Cache-Control: must-revalidate
Remove HTTP Headers

 Specify which HTTP headers you want to remove from the HTTP request.

Examples:

  • Cache-Control
  • X-AspNet-Version

For Small Files and Site Acceleration pull zone types you can override the HTTP Host header field value that CDN sends to the origin. Usually the value of the header depends on the domain name of the origin, but you may choose to override the default. This might be useful if for example you want to avoid creating additional DNS entries when switching over to CDN.

Rate limit settings

Transfer rate

Limits the bandwidth per single connection. Bandwidth throttling is set in kB/s (i.e. 1000 Bytes per second.) By default, no bandwidth throttling is applied. Changing this value will not affect existing connections.

Burst size

The initial data that can be downloaded at full speed before the above transfer rate takes effect.

Edge settings


Gzip compression

Reduces the size of web content and improves the overall speed.
LeaseWeb CDN currently only gzips the following types:

application/ecmascript;
application/javascript;
application/json;
application/postscript;
application/x-javascript;
image/svg+xml;
text/css;
text/csv;
text/javascript;
text/plain;
text/xml;

Ignore cookies

When set to Active the edge servers will ignore cookies. This will affect the server side cookies but not the client side cookies (e.g.: Google analytics).

When working with cookies, each user will get their own cached version due to the unique session ID. By activating the "Ignore Cookies" the edge will be able to cache your content more effectively.

Ignore Vary Headers

When set to Inactive the Vary headers will be taken into account for caching.

Because many web servers send incorrect Vary headers they are ignored by default. However, if you've put hard work into getting the Vary settings right, then this option can be used to optimize the CDN caching, resulting in better performance and more value.

Cache query string

By default the query string is not used to determine the cache key. For example, the URI's http://example.com/file?key=val1 will result in the same cache key as http://example.com/file?key=val2

If the query string determines the content of an object, you can use this option to specify what part of the query string is important. If the whole query string determines the content of the object, then select Full. If only part of the query string is relevant, then you can select Partial and provide a list of important parameters.

Use Stale

When set to Active the edge servers will server stale/expired content when your Origin server is down.

Content Disposition

Force web browsers to download the file instead of displaying it.

DVR

This setting is only available for Live Streaming pull zone type. Enabling this option will forward query arguments supplied for playlist and manifest files to origin. For example this allows video players to request specific date and time intervals for playing back recorded live event in case visitors missed it.

HTTP redirect

Use this option to redirect users from http to https with either the "Temporary" (302) or "Permanent" (301) HTTP response.

Security Settings


Blocked Countries

Blocked countries will block users based their IP address. We use the GeoIP database from MaxMind to match the IP to a country. Although this database is very accurate, we can not guarantee a 100% correctness when you enable this feature.

Whitelist

If you blacklisted any countries, but you allow specific IP's to have access, you can use the Whitelist to realize this. Add individual IP addresses or IP subnets to this list to ensure those users are allowed to access your content.

 

  • For example: you have added United States to the Block Countries list, but want to allow users from the IP subnet 123.123.123.0/30 (123.123.123.1 and 123.123.123.2). Simply add this subnet to the whitelist to ensure users from those IP addresses to have access to your content.
  • Subnets /24 and up are supported.
Referrer

Protects customer's content from hot linking, also called inline linking, by setting HTTP referral restrictions. By enabling this option, you can restrict direct linking to one or multiple entries, which may be a single word, a partial one, or a full domain name.

Secure URL

When activated, the zone will be protected, and files will be accessible with either a simple secret or a AES/SHA key.

If Secure URL is activated, the Cache query string settings will be ignored, and query parameters will not be treated as unique cacheable item.

Simple Secure URL

PHP example
Secure URL IP Restriction

When Secure URL is activated, you can choose to restrict protected links to the visitors IP address.

PHP example
Only Secure Manifest

Applicable only to Live Streaming pull zones, if enabled then only the manifest and playlist files will be covered by the Secure URL, the video chunks will be freely available for download.

Embed token into path

When activated changes the position of Secure URL tokens from query arguments to the beginning of the path. It can be useful for e.g. securing the video chunks under the specific path without changing the playlist that contains relative paths. The URL is changed as follows: st argument value becomes the first path component, the e argument becomes the second path component, the actual path starts with the third component.

 

Example

/path/to/secret_file.pdf?st=STHASH&e=12345

becomes:

/STHASH/12345/path/to/secret_file.pdf
PHP example
Number of path components

When set to the value other than “Whole URL” this option allows you to limit the amount of path components that are protected by the Secure URL. So you have the ability to secure the directory and all its files and subdirectories with a single Secure URL generated token.

 

Note that there is no slash (/) at the end of the $path variable, it's important not to include it during hashing.

PHP example
For this specific example to work you'll need to set “Number of path components” to 3 based on the amount of directories in $path.
Encrypted Secure URL

PHP example

 

SSL certificate

This option allows you to use HTTPS with your own certificate for the specified pull zone.

SSL support

Activate this option to enable the ability to upload custom SSL certificate.

Private key

SSL private key that corresponds to the site certificate. Private key must have no password protection set. Private key is usually generated by you and a Domain certificate is issued by the external Certificate Authority based on your Private key.

Domain certificate

Certificate for the domain of your pull zone. It must correspond to the Private key you provided earlier. The certificate must be valid at the time of the upload and must contain Common Name or Subject Alternative Name fields that correspond to the domain of the pull zone. Domain certificate is usually issued by the Certificate Authority based on your Private key.

Intermediate CA bundle (optional)

Intermediate certificates of the Certificate Authority that issued your Domain certificate. Can contain several certificates one after another. They must form a proper chain of trust between Domain certificate and one of the common Root certificates. Intermediate CA bundle is usually provided by the Certificate Authority that issued your Domain certificate.

Let's Encrypt

Unfortunately we do not yet support Let's Encrypt.

Viewing a Pull Zone

Perform the following steps while logged into the CDN Control Panel to add a Pull Zone:

  1. On the Pull Zones page click the "View" button for the zone for which you want to view the details.
  2. The Pull Zone details page is displayed.

Editing a Pull Zone

Perform the following steps while logged into the CDN Control Panel to edit a Pull Zone:

  1. On the Pull Zones page click the "Edit" button next to the zone that you want to edit.
    The Edit page for that particular zone type is displayed.



  2. Update the information and click the "Save" button. 

Deleting a Pull Zone

Perform the following steps while logged into the CDN Control Panel to delete a Pull Zone:

  1. On the Pull Zones page click the "Delete" button for the zone that you want to delete.
  2. A confirmation box is displayed.



  3. Click the "OK" button to confirm deleting the selected zone.

Keywords
You can click on any of the keywords below this article to see all related articles for that keyword

 

  • No labels