A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.fastly.com/guides/basic-configuration/enabling-automatic-gzipping below:

Enabling automatic compression | Fastly Documentation

  1. Home
  2. Guides
  3. Full-Site Delivery
  4. Performance

Enabling automatic compression

Compression can help you reduce the size of your assets so traffic can flow faster. You can use Fastly to compress data automatically on our edge servers.

Much of the data delivered by Fastly can be compressed using static compression, especially text-based formats like HTML, JavaScript, and CSS. Static compression fetches content from origin, compresses it according to the user's requested format (either Brotli or gzip), and then caches it.

Dynamic compression, on the other hand, compresses content just before responses are delivered to the client and is used on content that can’t be cached. For example, dynamic compression can compress content unique to an end user.

Limitations and caveats

Keep in mind the following:

When considering the general behavior of Fastly's compression feature, keep in mind the following:

Enabling static compression

This section demonstrates how to use the Fastly control panel to enable and disable static compression for cacheable content. To enable compression, select a compression format and then set up a compression policy.

WARNING: Enabling static compression or changing the compression format immediately impacts all service versions, including the active one.

Selecting a compression format

To enable compression, start by selecting a compression format using the steps below:

  1. Log in to the Fastly control panel.

  2. From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.

  3. Click Edit configuration and then select the option to clone the active version.

  4. Click Content.

  5. Scroll to the Compression area. From the Select compression format options, do one of the following:
Setting up a compression policy

Once you've selected the compression format, you'll need to set up a compression policy. Decide whether to:

Enabling the default compression policy

To enable the default compression policy, follow these steps:

  1. Click the Default compression policy switch to enable compression using the format you selected to compress content using the default list of file extensions.
  2. Click Activate to deploy your configuration changes.

Setting up an advanced compression policy

To set up an advanced compression policy, follow these steps:

  1. Click Set up advanced compression.

  2. Click Override these defaults.

  3. Fill out the Create a compression policy fields as follows:

  4. Click Create. The new compression policy appears.

  5. Click Activate to deploy your configuration changes.

Disabling static compression

If you're currently using the default compression policy, you can disable compression by clicking the Default compression policy switch to display OFF.

If you're currently using an advanced compression policy, you can disable compression by deleting it using the trash to the right of the policy's title:

WARNING: Disabling static compression immediately impacts all service versions, including the active one.

Automatic normalization

Because compression is one of the most common reasons to vary output based on a request header, Fastly will normalize the value of Accept-Encoding on incoming requests. The modified header will be set to a single encoding type, or none, and will reflect the best compression scheme supported by the browser.

Specifically, we run the following steps on inbound requests:

  1. If the User-Agent matches a pattern for browsers that have problems with compressed responses, remove the Accept-Encoding header
  2. Else if the Accept-Encoding header includes the string br, set the entire value to the string br
  3. Else if the Accept-Encoding header includes the string gzip, set the entire value to the string gzip
  4. Else if the Accept-Encoding header includes the string deflate, set the entire value to the string deflate
  5. Else remove the Accept-Encoding header

Where this normalization process has changed the header value, the original value is made available in the custom header Fastly-Orig-Accept-Encoding.

Enabling dynamic compression

Fastly’s Dynamic Content Compression feature allows you to compress dynamic content that wouldn’t benefit from caching, like video streaming manifests and dynamic content from Compute applications. Once compressed, you are also able to apply dynamic web content assembly techniques like ESI. Our guide to delivering compressed content through Fastly discusses how to enable compression using custom VCL or the Fastly API via the X-Compress-Hint header and includes workflows for compressing dynamic content.

Related content

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4