Current filter:
                                You should refresh the page.
                                  • Note: this article describes the dashboard's server-side data caching functionality, corresponding API, and how to force updating of the cached data. In addition to the dashboard's server-side cache, Internet Explorer uses a separate cache where it stores requests and provided data. We suggest you start testing the dashboard's server-side caching API using another browser (i.e. Chrome). To learn how to avoid caching performed by the IE browser refer to the T652977: Web Dashboard - Why it is impossible to reload the in-memory data cache in IE article.

                                    The ASPxDashboard control (and its corresponding MVC 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, ASPxDashboard requests required data automatically by sending a query containing a corresponding SELECT statement.

                                    If the Client data processing mode is enabled for the data source, ASPxDashboard 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, applying master filtering).

                                    Cache Sharing
                                    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. Depending on the control / server-side API in use, the following specifics are applied to cache sharing.
                                    - For the ASPxDashboard control which uses its own server-side API (ASPxDashboard.UseDashboardConfigurator = false), the cache is shared across all users of the control's instance.
                                    - For the ASPxDashboard control which uses DashboardConfigurator's API (ASPxDashboard.UseDashboardConfigurator = true), the cache is shared across all users of all ASPxDashboard instances.
                                    - For the ASP.NET MVC Dashboard extension, the cache is shared across all users of all MVCxDashboard instances.

                                    Using 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 create different caches by implementing custom logic when handling the CustomParameters event.
                                    By default, the caches are shared between all users.

                                    If necessary, you can control access to different caches for different users by setting a unique parameter value for each user group.

                                    To do this, handle the CustomParameters event in the following way:

                                    DashboardConfigurator.Default.CustomParameters += (s, e) => {  
                                       e.Parameters.Add(new DevExpress.DataAccess.Parameter("UserGroup1", typeof(string), HttpContext.Current.Session["UserGroup1"].ToString()));  
                                    };  
                                    

                                    The parameter name-value pair is included in the cache key, and thus users will get the cache only for the corresponding user group. Also, note that parameters added in the CustomParameters event will not be passed to the client.

                                    Cache Life Cycle
                                    The Web Dashboard manages the in-memory cache using two independent approaches.
                                    - The Web Dashboard will clear 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.
                                    - The Web Dashboard allows you to set a time interval that specifies how frequently the Web Dashboard should refill its cache when a user sends a data request. You can change this time interval by handling the ConfigureDataReloadingTimeout event. For instance, if you set the DataReloadingTimeout event parameter to 100 seconds, the Web Dashboard will update the cache when a new request is received and the current cache version was created more than 100 seconds ago.

                                    When data is loaded for the first time, the Web Dashboard checks whether or not any cache exists. If so, the Web Dashboard checks whether this cache is older than 300 seconds and recreates it if necessary.

                                    Specifying the cache timeout on the server

                                    Depending on the control / server-side API in use, handle the following events.
                                    - For the ASPxDashboard control that uses its own server-side API (ASPxDashboard.UseDashboardConfigurator = false), use the ASPxDashboard.ConfigureDataReloadingTimeout event to change the default data reloading interval.
                                    - For the ASPxDashboard control that uses DashboardConfigurator's API (ASPxDashboard.UseDashboardConfigurator = true), handle the DashboardConfigurator.ConfigureDataReloadingTimeout event to specify the data reloading interval.
                                    - For the ASP.NET MVC Dashboard extension, handle the DashboardConfigurator.ConfigureDataReloadingTimeout event to specify the data reloading interval.

                                    How to refresh the control from the client side

                                    To refresh the control on the client side, it is possible to call the ASPxClientDashboard.Refresh method:

                                    [JavaScript]
                                    clientDashboardControl.Refresh();

                                    How to reset the cache manually

                                    Client Side: We implemented the ASPxClientDashboard.ReloadData method that allows you to reload data in all dashboard's data sources.

                                    Server Side:  To refresh the data source cache on the server side, it is necessary to pass a unique parameter value to the ASPxDashboard.CustomParameters or DashboardConfigurator.CustomParameters event (depending on the platform and Web Dashboard settings).

                                    For instance, you can store a unique GUID value within a Session or static variable as a parameter and update its value in your code when it is necessary to refresh the cache.

                                    [C#]
                                    public static class CacheManager { public static void ResetCache() { if (HttpContext.Current.Session != null) HttpContext.Current.Session["UniqueCacheParam"] = Guid.NewGuid(); } public static Guid UniqueCacheParam { get { if (HttpContext.Current.Session == null) return Guid.Empty; else { if (HttpContext.Current.Session["UniqueCacheParam"] == null) ResetCache(); return (Guid)HttpContext.Current.Session["UniqueCacheParam"]; } } } }

                                    Reset the cache in your code:

                                    [C#]
                                    public void ResetCache() { CacheManager.ResetCache(); }

                                    Pass the parameter to the CustomParameters event:

                                    [C#]
                                    DashboardConfigurator.Default.CustomParameters += (s, e) => { e.Parameters.Add(new DashboardParameter("Param1", typeof(Guid), CacheManager.UniqueCacheParam)); };

                                    OR

                                    [C#]
                                    protected void ASPxDashboard1_CustomParameters(object sender, CustomParametersWebEventArgs e) { e.Parameters.Add(new DashboardParameter("Param1", typeof(Guid), CacheManager.UniqueCacheParam)); }

                                    See also:
                                    T652977: Web Dashboard - Why it is impossible to reload the in-memory data cache in IE

                                0 Solutions

                                Creation Date Importance Sort by