---
title: Streaming Miss
summary: null
url: >-
  https://www.fastly.com/documentation/guides/full-site-delivery/performance/streaming-miss
---

When fetching an object from the origin, the Streaming Miss feature ensures the response is streamed back to the client immediately and is written to cache only after the whole object has been fetched. This reduces the first-byte latency (the time that the client must wait before it starts receiving the response body).

## Considerations

Fastly recommends enabling [Segmented Caching](https://www.fastly.com/documentation/guides/full-site-delivery/caching/segmented-caching) on services that will be serving large resources. Without Segmented Caching enabled, the resource size limits for your account depend on when you become a Fastly customer:

- If you created your account on or after June 17, 2020 and haven't enabled [Segmented Caching](https://www.fastly.com/documentation/guides/full-site-delivery/caching/segmented-caching), your Fastly services have a maximum object size of 20 MB.
- If you created your account prior to June 17, 2020 and haven't enabled [Segmented Caching](https://www.fastly.com/documentation/guides/full-site-delivery/caching/segmented-caching), your Fastly services have a maximum cacheable object size of 2 GB for requests without [Streaming Miss](https://www.fastly.com/documentation/guides/full-site-delivery/performance/streaming-miss) or 5 GB for requests with Streaming Miss.

> **HINT:** If you enable Streaming Miss, be aware that [if an error occurs](https://www.fastly.com/documentation/guides/full-site-delivery/performance/failure-modes-with-large-objects) while transferring the response body, Fastly cannot send an error because the headers are already sent to the client. All we can do is truncate the response.

## Enable Streaming Miss by creating a VCL Snippet

Enable Streaming Miss by setting `beresp.do_stream` to `true` in `vcl_fetch` with a VCL Snippet using these steps.

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2.   From the [**Home**](https://manage.fastly.com/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 **VCL**.
5. Click **VCL snippets**.
6. Click **Add snippet**.
7. Fill out the **Add VCL snippet** fields as follows:
   - Using the **Type** controls, select **Regular** to create a regular VCL snippet.
   - In the **Name** field enter an appropriate name (e.g., `Enabling Streaming Miss`).
   - Using the **Placement** controls, select **Within subroutine**.
   - From the **Subroutine** menu, select **fetch (`vcl_fetch`)**.
   - _(Optional)_ In the **Priority** field, enter the order in which you want the snippet to execute. Lower numbers execute first.
   - In the VCL editor, add `set beresp.do_stream = true;`.
8. Click **Add** to create the snippet.
9.   From the **Activate** menu, select **Activate on Production** to deploy your configuration changes.

## Enable Streaming Miss by creating a Fastly header

Enable Streaming Miss by setting `beresp.do_stream` to `true` in `vcl_fetch` with a Fastly header using these steps.

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2.   From the [**Home**](https://manage.fastly.com/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. Click **Create header**.

   ![Enable Streaming Miss](/img/new-header-enable-streaming-miss.png)

6. Fill out the Create a header fields as follows:
   - In the **Name** field, enter the name of your header rule (for example, `Enabling Streaming Miss`).
   - From the **Type** menu, select **Cache**, and from the **Action** menu, select **Set**.
   - In the **Destination** field, enter `do_stream`.
   - In the **Source** field, enter `true`.
   - From the **Ignore if set** menu, select **No** if you want the header in the **Destination** field modified or select **Yes** if you don't want it modified.
   - In the **Priority** field, enter the order the header rules execute.

7. Click **Create**.

8.   From the **Activate** menu, select **Activate on Production** to deploy your configuration changes.

## Streaming Miss limitations

There are several limitations to using Streaming Miss.

### Streaming Miss is not available to HTTP/1.0 clients

If an HTTP/1.0 request triggers a fetch and the response header from the origin does not contain a Content-Length field, then Streaming Miss will be disabled for the fetch and the fetched object will be subject to the non-streaming-miss object size limit of 2GB. Without the client receiving the Content-Length, the client cannot distinguish the proper end of the download from an abrupt connection breakage anywhere upstream from it.

If an HTTP/1.0 request is received while a Streaming Miss for an object is in progress, the HTTP/1.0 request will wait for the response body to be downloaded before it will receive the response header and the response body, as if the object was being fetched without Streaming Miss.

Cache hits are not affected. An HTTP/1.0 client can receive a large object served from cache, just like an HTTP/1.1 client.

### Streaming Miss is not compatible with on-the-fly compression of fetched objects

Streaming Miss can handle large files whether or not they are compressed. On-the-fly compression of objects not already compressed is not compatible with Streaming Miss. Specifically, if VCL sets `beresp.gzip` or `beresp.brotli` to true, Streaming Miss will be disabled.

### Streaming Miss is not compatible with ESI (Edge-Side Includes)

Responses processed through ESI, which dynamically inserts content into cached pages, cannot be streamed. Responses included from an ESI template also cannot be streamed. When ESI is enabled for a response or when a response is fetched using `<esi:include>`, then Streaming Miss will be disabled and the fetched object will be subject to the non-streaming-miss object size limit of 2GB.
