Class
CacheFactory

Factory class for creating built-in cache implementations for Telerik Reporting Services.

Definition

Namespace:Telerik.Reporting.Services.WebApi

Assembly:Telerik.Reporting.Services.WebApi.dll

Syntax:

cs-api-definition
[Obsolete("Telerik.Reporting.Services.WebApi.CacheFactory is now obsolete. Please use Telerik.Reporting.Services.Engine.CacheFactory instead.")]
public static class CacheFactory

Inheritance: objectCacheFactory

Methods

CreateDatabaseCache(string, string)

Creates a database-based cache instance using the specified database backend and connection string.

Declaration

cs-api-definition
public static ICache CreateDatabaseCache(string backendName, string connectionString)

Parameters

backendName

string

The database backend name (e.g., "SqlServer", "MySQL", "Oracle", "PostgreSQL"). Supported values depend on the Telerik OpenAccess configuration.

connectionString

string

A valid database connection string for connecting to the cache database. The format depends on the specified backend.

Returns

ICache

An ICache instance that stores cached data in the specified database.

Remarks

Prerequisites: Use the Database Cache Configuration Tool to create the database schema before using this method. Dependencies: Requires Telerik.OpenAccess.dll and Telerik.OpenAccess.35.Extensions.dll libraries. Assembly binding redirects may be required in the application configuration file.

CreateFileCache()

Creates a file-based cache instance using the system's temporary directory.

Declaration

cs-api-definition
public static ICache CreateFileCache()

Returns

ICache

An ICache instance that stores cached data in the system temp directory under "ReportService" folder.

Remarks

The cache directory will be automatically created at %TEMP%\ReportService if it doesn't exist.

CreateFileCache(string)

Creates a file-based cache instance using a specified directory.

Declaration

cs-api-definition
public static ICache CreateFileCache(string directory)

Parameters

directory

string

The directory path where cached data will be stored. The directory will be created if it doesn't exist.

Returns

ICache

An ICache instance that stores cached data in the specified directory.

Remarks

Ensure the application has read/write permissions to the specified directory location.