RouteHandlerViewResponse

A RouteHandlerViewResponse can be a ViewDefinitionResponse object or a ViewResponse object.

Use this object to customize response input handled by the LWR server.

PropertyTypeRequired/OptionalDescription
statusNumberOptionalThe HTTP response status code.
viewRouteHandlerViewRequiredA partial route.
viewParamsRecord<string, Json>RequiredThe record is passed into the templates as dynamic content.
renderOptionsRenderOptionsOptionalConfigure settings for metadata collection, embedded asset URLs, and caching the page view response.
cacheCacheResponseOptionalPage caching settings.
headersRecord<string, string>OptionalHTTP headers.
PropertyTypeRequired/OptionalDescription
skipMetadataCollectionBooleanOptionalTo skip parsing of body for <link> and <img> tags, set to true. The default value is false.
freezeAssetsBooleanOptionalTo construct immutable URLs for embedded assets, set this value to true. The default value is set to runtimeEnvironment.immutableAssets.
skipCachingBooleanOptionalTo not cache the page view response, set this value to true. The default value is false.
PropertyTypeRequired/OptionalDescription
ttlString/NumberOptionalSet the "max-age" for the "Cache-Control" header.

Use this object to return a completely custom response override.

PropertyTypeRequired/OptionalDescription
statusNumberOptionalThe HTTP response status code.
bodyBuffer/string/boolean/jsonRequiredThe response body.
cacheCacheResponseOptionalPage caching settings.
headersRecord<string, string>OptionalHTTP headers.

See Also