In my case, I have not configured those properties anywhere, so I don’t think they are causing the duplicate cache files. I suspect it might be related to my custom handler implementation.
I recently upgraded DocumentUltimate from v6.2.1 to v7.6.6. In the older version (6.2.1), my custom handler implementation worked fine and I did not see duplicate cache PDFs being generated. After upgrading to 7.6.6, I had to refactor some code because a few internal classes changed, and now I’m noticing this caching behavior.
public override string File
{
get;
set;
}
public override bool CanGetInfo => true;
public override bool CanOpenRead => true;
public override bool CanOpenWrite => false;
public override bool CanSerialize => false;
protected override FileProviderInfo DoGetInfo()
{
byte[] fileContent = new byte[0];
DateTime lastModified = DateTime.UtcNow;
string sql = string.Format(selectCommand, parentKey);
var dataSet = DataServiceBase.ExecuteDataset(connectionString, CommandType.Text, sql);
if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
{
if (isFileNameMapped)
{
this.File = dataSet.Tables[0].Rows[0][fileName].ToString();
}
if (mustBase64Decode)
{
fileContent = Convert.FromBase64String(dataSet.Tables[0].Rows[0][fileContentsField].ToString());
}
else
{
fileContent = (byte[])dataSet.Tables[0].Rows[0][fileContentsField];
}
}
return new FileProviderInfo(this.File, lastModified, fileContent?.LongLength ?? 0);
}
protected override Stream DoOpenRead()
{
byte[] fileContent = new byte[0];
string sql = string.Format(selectCommand, parentKey);
var dataSet = DataServiceBase.ExecuteDataset(connectionString, CommandType.Text, sql);
if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
{
if (mustBase64Decode)
{
fileContent = Convert.FromBase64String(dataSet.Tables[0].Rows[0][fileContentsField].ToString());
}
else
{
fileContent = (byte[])dataSet.Tables[0].Rows[0][fileContentsField];
}
}
return new MemoryStream(fileContent);
}