Skip to main content
A newer version of this page is available. .

CacheCleanerSettings Class

Provides time settings to clean a cache for storing documents and reports.

Namespace: DevExpress.XtraReports.Web.WebDocumentViewer

Assembly: DevExpress.XtraReports.v18.2.Web.dll

Declaration

public class CacheCleanerSettings :
    StoragesCleanerSettingsBase

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(); 

    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));
    });        
  }
//...    
}

Inheritance

Object
DevExpress.XtraReports.Web.WebDocumentViewer.Native.Services.StoragesCleanerSettingsBase
CacheCleanerSettings
See Also