CacheCleanerSettings Class
Provides time settings to clean a cache for storing documents and reports.
Namespace: DevExpress.XtraReports.Web.WebDocumentViewer
Assembly: DevExpress.XtraReports.v17.2.Web.dll
NuGet Package: DevExpress.Web.Reporting
Declaration
Related API Members
The following members return CacheCleanerSettings objects:
Remarks
According to the time settings specified in the CacheCleanerSettings class, the default cleaner service periodically checks if the memory cache contains documents/reports whose lifetime exceeds a specific amount of time. If such documents/reports are found, they are deleted. You can register a new instance of the CacheCleanerSettings class with required time settings using the DefaultWebDocumentViewerContainer.Register<T, TImpl> (.NET Framework)/ AddSingleton (.NET Core) method.
The following code demonstrates how to register custom settings in a .NET Framework application.
using DevExpress.XtraReports.Web.WebDocumentViewer;
//...
void Application_Start(object sender, EventArgs e) {
var dueTime = TimeSpan.FromSeconds(30);
var period = TimeSpan.FromSeconds(30);
var reportTimeTolive = TimeSpan.FromSeconds(30);
var documentTimeToLive = TimeSpan.FromSeconds(30);
DefaultWebDocumentViewerContainer.RegisterSingleton<CacheCleanerSettings>(new CacheCleanerSettings(dueTime, period, reportTimeTolive, documentTimeToLive));
}
//...
The following code demonstrates how to register custom settings in a .NET Core application.
using DevExpress.AspNetCore;
using DevExpress.AspNetCore.Reporting;
//...
public class Startup {
//...
public void ConfigureServices(IServiceCollection services) {
services.AddDevExpressControls();
services.AddMvc().AddDefaultReportingControllers();
var dueTime = TimeSpan.FromSeconds(30);
var period = TimeSpan.FromSeconds(30);
var reportTimeTolive = TimeSpan.FromSeconds(30);
var documentTimeToLive = TimeSpan.FromSeconds(30);
services.AddSingleton<CacheCleanerSettings>(new CacheCleanerSettings(dueTime, period, reportTimeTolive, documentTimeToLive));
});
}
//...
}