DevExtreme v23.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

ViewCache Deprecated

include spa-deprecated-note

An object that stores information about views displayed in the application.

Included in:, dx.web.js, dx.viz-web.js, dx.all.js
import ViewCache from "devextreme/framework/view_cache"


An application uses the viewCache object to save information on the views that were displayed so that this information is used the next time these views are displayed. This allows you to avoid gathering information on a view each time it is displayed and thus shorten the time a view display process takes. You may need to access the application's view cache. To access the application's view cache, use the viewCache field of the HtmlApplication object.

You can influence the way the application's view cache works. In addition, you can provide a custom view cache object to be used by the application. For details, refer to the description of the viewCache application configuration option.


This section describes the methods used to manipulate the application's view cache.

Name Description

Removes all the viewInfo objects from the cache.


Obtains a viewInfo object from the cache by the specified key.


Checks whether or not a viewInfo object is contained in the view cache under the specified key.


Detaches all event handlers from a single event.

off(eventName, eventHandler)

Detaches a particular event handler from a single event.

on(eventName, eventHandler)

Subscribes to an event.


Subscribes to events.


Removes a viewInfo object from the cache by the specified key.

setView(key, viewInfo)

Adds the specified viewInfo object to the cache under the specified key.


This section describes events fired by the ViewCache object.

Name Description

Fires after an item is removed from the view cache.