A Fastly C@E specific implementation of FetchEvent.

Hierarchy

  • FetchEvent

Properties

Methods

Properties

client: ClientInfo

Information about the downstream client that made the request

request: Request

The downstream request that came from the client

Methods

  • Send a response back to the client.

    Note: The service will be kept alive until the response has been fully sent.

    If the response contains a streaming body created by the service itself, then the service will be kept alive until the body ReadableStream has been closed or errored.

    However, if the body is a stream originating in a request to a backend, i.e. if a backend response's body is passed as input to the Response constructor, the service will not be kept alive until sending the body has finished.

    Note: If response is a Promise, the service will be kept alive until the response has been resolved or rejected, and the Response it resolved to has been fully sent.

    Note: Use waitUntil to extend the service's lifetime further if necessary.

    Parameters

    • response: Response | PromiseLike<Response>

      Response to send back down to the client

    Returns void

  • Extend the service's lifetime to ensure asynchronous operations succeed.

    By default, a service will shut down as soon as the response passed to respondWith has been sent. waitUntil can be used to ensure that the service will stay alive until additional asynchronous operations have completed, such as sending telemetry data to a separate backend after the response has been sent.

    Parameters

    • promise: Promise<any>

      The Promise to wait for

    Returns void

Generated using TypeDoc