This article describes the dashboard's server-side data caching functionality, corresponding API, and how to update the cached data.
The MVCxDashboard extension can display dashboards supplied with data using different types of data sources, which include SQL databases, Excel files, Entity Framework data sources, etc. If a data source uses the Server data processing mode, MVCxDashboard requests data automatically by sending a query containing a corresponding SELECT statement.
If the Client data processing mode is enabled for the data source, MVCxDashboard creates a server-side in-memory cache that stores data from the data source in an optimized way. This capability accelerates specific client-side actions that require data updates (for instance, when you apply master filtering).
The in-memory cache is created when data is loaded for the first time. The Web Dashboard can create several caches to accelerate data loading for different dashboards/data sources. For the ASP.NET MVC Dashboard extension, the cache is shared across all users of all MVCxDashboard instances.
Use Different Caches for Different User Groups
The Web Dashboard can create several caches to accelerate data loading for different dashboards/data sources. Each cache has its own unique key that contains predefined and custom parts:
The first part describes the dashboard object model, including information about the data source.
The second part includes dashboard parameters (name-value pairs). You can implement custom logic when handling the CustomParameters event to create different caches.
The caches are shared between all users by default:
You can manage access to different caches for different users. For this, set a unique parameter value for each user group:
The parameter name-value pair is included in the cache key - users get the cache only for the corresponding user group. Parameters added in the CustomParameters event is not passed to the client.
Cache Life Cycle
The Web Dashboard manages the in-memory cache in the following independent ways:
The Web Dashboard clears the cache if the time interval between two data requests exceeds 300 seconds. If the time interval between two data requests is less than 300 seconds, the Web Dashboard leaves the old cache unchanged and starts the timer again.