Programming Guide   >   Viewing   >   Data Model   >   Stream Cache
In this section:

Overview

"Stream Cache" is the internal data format of HOOPS Communicator designed for fast model streaming and client/server interaction. It is a highly compressed format derived from our own PRC standard with support for the full breadth of geometry and product structure information found in CAD models.

Frequently, a Stream Cache model will be the result of a CAD conversion via our conversion tools, but you can also author your own Stream Cache data from scratch. For more information on how to convert your own CAD data into the SC format or to author data in the SC format, please see the links below:

Format Variants

A Stream Cache model can come in different forms depending on the use case: It can be a file or multiple files on disk, or it can be just a memory buffer transferred from the server. The SC format variants that HOOPS Web Viewer supports are described below. For more information on how to load an SC model please see the Configuration section of the Programming Guide.

SC Directory

By default, the conversion tools generate a directory containing all the relevant parts of an SC model directly accessible to the server. The directory also contains data useful for model editing and serialization workflows, though such workflows are currently not fully supported by the HOOPS Web Viewer. You should choose this format if associating multiple files to a model is not an issue for your server backend and you don't want to incur a performance penalty for a decompression step:

See above for the typical content of an SC model. The content of an SC directory is for "internal" use only and should be regarded as a single unit. However, if you are not interested in editing workflows you can delete the _meshes.sci file, which contains the uncompressed mesh data of the model.

To generate an SC model as a folder simply use the –output_sc command line option in converter. For more information, see the Command Line Options section of the Programming Guide.

SCZ

The SCZ file is a single file version of the above SC directory. It is a useful format if you want to maintain a one-to-one relationship between the converted (or authored) CAD model and the SC model on your backend. It comes in two different flavors:

SCS

While all the above-mentioned variants of the Stream Cache format support server-side streaming, SCS files are specifically designed to be directly readable by HOOPS Web Viewer in the browser without a server connection. They cannot be read by the server and are meant for viewing scenarios where no server is present.

When we first designed HOOPS Communicator, having quick access to models was one of the key design goals but we quickly realized that it can be challenging to set up the server infrastructure to manage many simultaneous streaming sessions. To help simplify deployment of the HOOPS Web Viewre, we introduced the SCS format. In addition to reducing server complexity, SCS files will often be cached in the browser, so if an SCS file is already cached locally, viewing the model might actually be faster with this method than streaming it via the server.

The downside is that an SCS file must be completely downloaded to the HOOPS Web Viewer before it can be viewed. It is organized in a way that as soon as it is downloaded it will have a similar streaming behavior as a regular SC model served by the HOOPS Server. However, as opposed to server-based streaming, all the data within an SCS file will be fully parsed and added to the HOOPS Web Viewer database, so there is no camera-dependent streaming when loading SCS files.

To generate an SCS file, use the --output_scs command-line option.

SC models streamed from the server (either as a directory or in the two SCZ variants) cannot be mixed with SCS file loading, so it is not possible to add an SCS file into a viewing session with a server connection and vice versa. HOOPS Web Viewer is either in server-based streaming mode or it is not connected to the server – it cannot switch modes after initialization.