HST Server Side Includes Support
Overview
Bloomreach Content (HST) supports generating Server Side Includes (SSI) statements. This allows external SSI processors—such as Apache HTTP Server, Nginx, Lighttpd, or IIS—to asynchronously include specific components in the final HTML output.
Server Side Includes (SSI) is a server-side scripting language commonly used to insert dynamic content into web pages. SSI directives are embedded in HTML comments, so if SSI is not enabled, users will not see any visible change unless they view the page source.
Example SSI syntax:
<!--#directive parameter=value parameter=value -->
Configuring HST Components to Render SSI Markup
An HST page is composed of a tree of HST Components, which are managed in the repository.
To enable SSI rendering for an HST Component:
-
Set the
hst:asyncproperty totrueon the component. This marks the component and its descendants for asynchronous rendering.hst:async: trueBy default, this configuration causes the component to render asynchronously using client-side AJAX calls.
For more information, see Asynchronous HST Components and Containers.
-
To use server-side SSI processing instead of AJAX, set the
hst:asyncmodeproperty tossi:hst:asyncmode: ssiThe default value for
hst:asyncmodeisajax.
When you configure an HST Component as asynchronous and set hst:asyncmode to ssi, the component's markup is replaced with an SSI include directive in the initial response. For example:
<!--#include virtual="/news?_hn:type=component-rendering&_hn:ref=r1_r2" -->
The virtual attribute references an HST Component Rendering URL. This URL renders only the specific component window (identified by the namespace, such as r1_r2), not the entire page.
The initial page response includes the HTML markup for all descendant HST Components, except for those configured for SSI-based asynchronous rendering. For these, the output is replaced with an SSI directive as shown above.
After the page is served, an external SSI processor (such as Nginx or Apache HTTP Server) processes the SSI directives. The processor requests the specified include URLs (e.g., /news?_hn:type=component-rendering&_hn:ref=r1_r2), retrieves the rendered HTML for each component, and replaces the SSI markup with the actual content before delivering the final page to the client.