DocumentUltimate Cache Problem
Problem reported by James Flynn - March 19 at 2:02 AM
Not A Problem
i am using DocumentUltimate 4.6 version but one very strange and serious problem i am facing that . we gaving lots of suppliers who is uplaoding documents but many time Document Ultimate showing document whcih supplier dpnt want to see. then when i removed the cache then supplier able to see their document.

i did everything  like i change the UNIQUEID with the current timestamp reduce the cache age to 1 min . now what do i do?

can you look into this as we may landed into legal problem ?

1 Reply

Reply to Thread
0
Cem Alacayir Replied
Employee Post
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);

Reply to Thread