- English
- 日本語
Streaming Miss
Last updated 2023-02-07
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).
TIP
Fastly recommends enabling 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, 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, your Fastly services have a maximum cacheable object size of 2 GB for requests without Streaming Miss or 5 GB for requests with Streaming Miss.
NOTE
If you enable Streaming Miss, be aware that if an error occurs 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.
- Log in to the Fastly web interface.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click Edit configuration and then select the option to clone the active version.
Click VCL Snippets.
Click Create your first VCL snippet.
Fill out the Create a VCL snippet fields as follows:
- In the Name field enter an appropriate name (e.g.,
Enabling Streaming Miss
). - From the Type (placement of the snippets) controls, select within subroutine.
- From the Select subroutine menu, select fetch (
vcl_fetch
). - In the VCL field, add
set beresp.do_stream = true;
.
- In the Name field enter an appropriate name (e.g.,
Click Create to create the snippet.
- Click Activate 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.
- Log in to the Fastly web interface.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click Edit configuration and then select the option to clone the active version.
- Click Content.
Click Create header.
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.
- In the Name field, enter the name of your header rule (for example,
Click Create.
- Click Activate 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.
Do not use this form to send sensitive information. If you need assistance, contact support. This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.