Note that when using a stream (or byte array) source, you should ensure you provide a reliable unique ID for it, this way DocumentCache can know if it’s the same document or a different document to minimize conversions. So once a document is converted and cached, it’s served immediately without any waiting for consecutive requests.
uniqueId
The unique identifier that will be used for generating the cache key for this document. For instance, it can be an ID from your database table or a simple file name; you just need to make sure this ID varies for each different document so that they are cached correctly. For example for files on disk, we internally use a string combination of file extension, file size and file date for uniquely identifying them, this way cache collisions do not occur and we can resuse the cached file even if the file name before extension is changed (because it's still the same document).
> i did everything like i change the UNIQUEID with the current timestamp
I don't recommend using current timestamp for it. For example for files on disk, a reliable uniqueId can be generated like this:
var fileInfo = new FileInfo(sourceDocumentPath);
var uniqueId = string.Concat(
fileInfo.Extension.ToLowerInvariant(),
fileInfo.Length,
fileInfo.LastWriteTimeUtc.Ticks);
For example if the source document comes from a database, you can use the Id for that specific document entry and optionally append the supplier Id (so that you can isolate cached files for each supplier):
var uniqueId = string.Concat(documentDbId, supplierDbId);