---
title: Gzip
summary: Gzip configuration allows you to choose resources to automatically compress.  For more information about compressing and decompressing data with Fastly, check out our <a href="https://www.fastly.com/documentation/learning/concepts/compression/">concept guide to compression</a>.
url: https://www.fastly.com/documentation/reference/api/vcl-services/gzip
---

Gzip configuration allows you to choose resources to automatically compress.  For more information about compressing and decompressing data with Fastly, check out our <a href="https://www.fastly.com/documentation/learning/concepts/compression/">concept guide to compression</a>.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `cache_condition` | string | Name of the cache condition controlling when this configuration applies. |
| `content_types` | string | Space-separated list of content types to compress. If you omit this field a default list will be used. |
| `extensions` | string | Space-separated list of file extensions to compress. If you omit this field a default list will be used. |
| `name` | string | Name of the gzip configuration. |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `deleted_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `service_id` | string | Alphanumeric string identifying the service. (Read-only) |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `version` | string | String identifying a service version. (Read-only) |

## API endpoints

### List gzip configurations

**GET** `/service/{service_id}/version/{version_id}/gzip`

List all gzip configurations for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Create a gzip configuration

**POST** `/service/{service_id}/version/{version_id}/gzip`

Create a named gzip configuration on a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Get a gzip configuration

**GET** `/service/{service_id}/version/{version_id}/gzip/{gzip_name}`

Get the gzip configuration for a particular service, version, and name.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `gzip_name` | string | path | Yes | Name of the gzip configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Update a gzip configuration

**PUT** `/service/{service_id}/version/{version_id}/gzip/{gzip_name}`

Update a named gzip configuration on a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `gzip_name` | string | path | Yes | Name of the gzip configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Delete a gzip configuration

**DELETE** `/service/{service_id}/version/{version_id}/gzip/{gzip_name}`

Delete a named gzip configuration on a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `gzip_name` | string | path | Yes | Name of the gzip configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

