RouteHandlerViewResponse
A RouteHandlerViewResponse can be a ViewDefinitionResponse object or a ViewResponse object.
Use this object to customize response input handled by the LWR server.
| Property | Type | Required/Optional | Description |
|---|---|---|---|
status | Number | Optional | The HTTP response status code. |
view | RouteHandlerView | Required | A partial route. |
viewParams | Record<string, Json> | Required | The record is passed into the templates as dynamic content. |
renderOptions | RenderOptions | Optional | Configure settings for metadata collection, embedded asset URLs, and caching the page view response. |
cache | CacheResponse | Optional | Page caching settings. |
headers | Record<string, string> | Optional | HTTP headers. |
| Property | Type | Required/Optional | Description |
|---|---|---|---|
skipMetadataCollection | Boolean | Optional | To skip parsing of body for <link> and <img> tags, set to true. The default value is false. |
freezeAssets | Boolean | Optional | To construct immutable URLs for embedded assets, set this value to true. The default value is set to runtimeEnvironment.immutableAssets. |
skipCaching | Boolean | Optional | To not cache the page view response, set this value to true. The default value is false. |
| Property | Type | Required/Optional | Description |
|---|---|---|---|
ttl | String/Number | Optional | Set the "max-age" for the "Cache-Control" header. |
Use this object to return a completely custom response override.
| Property | Type | Required/Optional | Description |
|---|---|---|---|
status | Number | Optional | The HTTP response status code. |
body | Buffer/string/boolean/json | Required | The response body. |
cache | CacheResponse | Optional | Page caching settings. |
headers | Record<string, string> | Optional | HTTP headers. |
See Also