Available inall subroutines.
State of the request, with optional suffixes describing special cases.
|No state assigned.
|The request has matched previously-cached content as a result of a cache lookup.
|The cache key associated with this request has been previously marked uncacheable in
vcl_fetch, which will trigger a PASS and prevent the resulting backend response from being cached. Never a final state.
|The request has matched previously-cached, stale content as a result of a backend failure or a
|The request has transited
vcl_error as a result of a network error during a backend fetch or an explicit
error statement, and a
synthetic response has been created with a non-error status code.
|The request has been or will be sent to a backend server as a result of failing to find suitable content in cache.
|The request has been or will be sent to a backend server as a result of an explicit
return(pass) or because a hit-for-pass object was found in cache.
|An error occurred during a background fetch in
[state] (possible options:
vcl_error with a response code of 400 or higher.
|Fastly ran out of memory during header processing.
|The request has been transferred to a second cache node due to clustering.
|A backend fetch returned a
304 Not Modified response, and Fastly is therefore able to serve cached content that would otherwise be considered stale.
|This request was collapsed with other requests and placed in a queue because a compatible request was already in progress.
fastly_info.state is used in the following code examples. Examples apply VCL to real-world use cases and can be deployed as they are, or adapted for your own service. See the full list of code examples for more inspiration.
Click RUN on a sample below to provision a Fastly service, execute the code on Fastly, and see how the function behaves.
Fastly offers a myriad of different variables that you can log. See and test a large collection here.