Edge Server Compression

Our edge servers can be configured to compress certain types of assets before they are delivered to your clients.

Setup

Edge server compression will be applied under the following circumstances:

Requirement Description

Platform-Specific Compression

Edge server compression must be enabled on the desired platform.

Turn on edge server compression through the Compression Enabled option on the Compression page.

Content Type

Edge server compression must be enabled for the content type of the requested content.

The type of assets that will be compressed is determined by the set of content types that have been specified in the File Types option on the Compression page. Content type identifies an assetA file is the most commonly known example of an asset. Refers to any collection of data that is typically stored as a single unit on a storage unit (e.g., disk drive). An example of an asset that is not physically stored on a disk drive occurs when dynamically generated content is not cached. by type and subtype.

Sample content types are provided below.

Content Type File Type

text/plain

Text files

text/html

HTML files

Accept-Encoding Request Header

The request must include an Accept-Encoding header set to one or more of the following compression types:

  • gzip
  • deflate
  • bzip2

This header allows the user agentRefers to software that acts on behalf of a user. For example, a web browser (e.g., FireFox, Chrome, and Internet Explorer) is a user agent. A web browser will make HTTP/HTTPS requests based on user actions (e.g., requesting a web site or clicking a link). to indicate which compression methods it supports to the origin server.

Cache Status

The requested content must already be cached on the POP closest to the requester.

File Size

The file size of the requested content must fall within the following range:

  • Greater than approximately 128 bytes (Content-Length: 128)
  • Less than approximately 3 MB

Key information:

To set asset compression

  1. Navigate to the Compression page. ClosedHow?From the main menu, navigate to CAN | Cache Settings | Compression.

  2. Make sure that the Compression Enabled option is selected.
  3. In the File Types list, make sure that only the desired content types are listed. For each content type that is not currently listed, append a comma and the content type (i.e. type/subtype).
  4. Click Update to save your changes.

It may take up to an hour for your changes to take effect.

How Does It Work?

An edge server may apply compression to the requested asset.

Basic Workflow

Requests for an assetA file is the most commonly known example of an asset. Refers to any collection of data that is typically stored as a single unit on a storage unit (e.g., disk drive). An example of an asset that is not physically stored on a disk drive occurs when dynamically generated content is not cached. that has not been cached is always served without compression.

CAN Gateway servers do not compress content.

Once the requested assetA file is the most commonly known example of an asset. Refers to any collection of data that is typically stored as a single unit on a storage unit (e.g., disk drive). An example of an asset that is not physically stored on a disk drive occurs when dynamically generated content is not cached. is eligible to be cached, it will be compressed and then cached on an edge server. All subsequent requests for that asset may be served with compression.

By default, content served through the CAN platform is not cached and therefore will be served uncompressed.

Detailed Workflow

The process through which requested content is compressed is outlined below. This process assumes that a client performed a request that is eligible for edge server compression.

  1. An edge server on the POP closest to the client will check to see if the requested content has been cached and if it still has a valid TTL.

    • Compressed Cache Hit: An edge server will immediately deliver the compressed content to the client.
    • Uncompressed Cache Hit: An edge server will compress the requested content, serve it to the client, and then cache the compressed asset.
    • Cache Miss: If the asset has not been cached, then the request will be forwarded to an origin server. Proceed to the next step.
  2. The response from the origin server will be one of the following:

    • Compressed Content: An edge server will deliver the compressed content to the client.

      Learn more.

    • Uncompressed Content: An edge server will serve the uncompressed content to the client. After which, an edge server may then compress the requested content and then cache the compressed version.