Viewing Session resources require a number of conversions to create content that is suitable for viewing. Caching the converted content plays a large role in the performance of the PrizmDoc Server when handling requests for a Viewing Session. In single-server mode, caching is the most optimized because all converted content is available to the PrizmDoc Services on that server. As requests for new viewing sessions are received, the new documents are examined to locate existing content that may already be created if the same document was used in a previous viewing session.
In cluster mode, the PrizmDoc Services on each server maintain their own cache data, separate from other PrizmDoc Servers. Cache data is not shared across servers. Because of this, the effort to convert the same document will likely be duplicated on multiple PrizmDoc Servers if you have a situation where users are frequently viewing the same document more than once.
To counteract this side-effect of cluster mode, the PrizmDoc Services provide a way to increase the chances that a request for a new viewing session will be sent to the same PrizmDoc Server that may have already converted the same document. This is done by providing a "hint" value in a HTTP header of the request to create new viewing sessions. Below is an example request that sets this header:
Example |
Copy Code
|
---|---|
POST http://192.168.0.1:18681/PCCIS/V1/ViewingSession Accusoft-Affinity-Hint: my-unique-document-name.docx { "tenantId": "my application name", "externalId": "my-unique-document-name.docx", "render": { "html5": { "alwaysUseRaster": false } } } |
The Accusoft-Affinity-Hint header should only be specified in the HTTP request that creates a new viewing session.
It is important to note that the value used in this header should uniquely identify the document. A document name or a unique ID from a database are good options. Using the same value for documents that are not identical will unbalance the requests across the PrizmDoc Servers as it will cause a single server to be favored for all requests that contain the same hint value.
Note that the Accusoft-Affinity-Hint header is unnecessary when creating a viewing session through the PAS API. Refer to the PAS Services Cluster Environments topic for more information on cache optimization for PAS.