Response
Extends Body.
The Response class as specified by WHATWG
Note: Can only be used when processing requests, not during build-time initialization.
See also
Constructor
Properties
The response headers.
May be modified even for upstream responses prior to storage in the cache.
The response status. May be modified prior to storage in the cache.
Fastly-specific property - obtain the IP address used for the request
Undefined for user-created responses and when the response is returned from the cache. Set cacheOverride: new CacheOverride("pass") to ensure a value.
Fastly-specific property - Obtain the port used for the request
Undefined for user-created responses and when the response is returned from the cache. Set cacheOverride: new CacheOverride("pass") to ensure a value.
The backend this response was received from, or undefined for
user-created responses.
Fastly-specific property - Returns whether the Response resulted from a cache hit.
For request collapsing, typically one response will show as a miss, and the others
(that awaited that response) will show as hits.
Undefined if the environment does not support the new HTTP Cache hostcalls.
Fastly-specific property - Returns whether the cached Response is considered stale.
Undefined if the environment does not support the new HTTP Cache hostcalls.
Fastly-specific property - Get the Time to Live (TTL) in the cache for this response in seconds, if it is cached.
The TTL determines the duration of "freshness" for the cached response after it is inserted into the cache.
Undefined if the response is not cached or the environment does not support the HTTP Cache hostcalls. May be modified prior to injection into the cache.
Fastly-specific property - The current age of the response in seconds, if it is cached.
Undefined if the response is not cached or the environment does not support the HTTP Cache hostcalls. May be modified prior to injection into the cache.
Fastly-specific property - The time in seconds for which the response can safely be used despite being considered stale, if it is cached.
Undefined if the response is not cached or the environment does not support the HTTP Cache hostcalls. May be modified prior to injection into the cache.
Fastly-specific property - The set of request headers for which the response may vary.
Undefined if the response is not cached or the environment does not support the HTTP Cache hostcalls. May be modified prior to injection into the cache.
Fastly-specific property - The surrogate keys for the cached response.
Undefined if the response is not cached or the environment does not support the HTTP Cache hostcalls. May be modified prior to injection into the cache.
Fastly-specific property - Get or set whether this response should only be stored via PCI/HIPAA-compliant non-volatile caching.
See the Fastly PCI-Compliant Caching and Delivery documentation for details.
Undefined if the response is not cached or the environment does not support the HTTP Cache hostcalls. May be modified prior to injection into the cache.
Methods
setManualFramingHeaders
View sourcesetManualFramingHeaders(manual: boolean): voidControls how framing headers (Content-Length, Transfer-Encoding) are
determined. In "manual" mode, any provided framing headers will be
honored. In "automatic" mode (the default), they are set based on the
body.
Parameters
- manual: boolean
Whether to use manual mode for framing headers.
Returns