Hi John,
Thank you for contacting Syncfusion support.
Yes, our PDF Viewer supports multiple users requesting the same/different documents. We are maintaining separate memory cache for each document with the unique id, so the requested document data will be retrieved from the respective cache and displayed in the viewer. We are maintaining the document live count and based on that the document will be removed from the cache when it is unloaded. So when the same document is viewing by the two users, the same cache will be used, and then it will be removed only when the document live count will be zero.
We have also provided support for IDistributedCache in our PDF Viewer Controller
Kindly follow the below steps for using the Redis Cache,
STEP 1: To use Redis cache in PDF Viewer service, install the following NuGet package,
STEP 2: To configure the Redis cache in PDF Viewer service, you have to add the following changes in Startup.cs
|
services.AddMemoryCache();
services.AddDistributedRedisCache(options =>
{
options.Configuration = Configuration.GetConnectionString("Redis");
}); |
STEP 3: We have to use IDistributedCache instead of IMemoryCache in PdfViewerController.cs. Please find the PDF Viewer service sample and code snippet below.
|
PdfViewerController.cs
private IDistributedCache _cache;
public PdfViewerController(IHostingEnvironment hostingEnvironment, IDistributedCache cache)
{
_hostingEnvironment = hostingEnvironment;
_cache = cache;
} |
Please try it and revert us with more details about your requirement, if you still need further assistance. These details will be helpful for us to investigate further and assist you better.
Regards,
Akshaya