Skip to content

Dashboard Cache

The admin dashboard brings with it a custom cache type: hyva_admin_dashboard. The corresponding class is: Hyva\AdminDashboardFramework\Model\Cache\Type\AdminDashboard.

This cache is currently used to store:

Widget Type Configuration

The widget type configurations specified throughout the various etc/adminhtml/hyva_dashboard_widget.xml files are compiled, parsed, converted into an array, and cached.

The Hyva\AdminDashboardFramework\Model\WidgetConfig class can be used to access the compiled and converted widget type configuration values. These values are the result of work performed by the Hyva\AdminDashboardFramework\Model\Config\Widget\Converter class and are currently grouped as follows:

  • widget_pool: set of configuration values keyed by widget type ID
  • widget_categories: set of configuration values, grouped by category
  • widget_tags: set of configuration values, grouped by tag
  • widget_templates: set of template paths, keyed by widget type ID

Widget Instance Content

To ensure widgets are performant, their content (i.e. the result of their getDisplayData() function) is also cached. This is done whenever a widget instance is saved.

Widget instance content is served from the cache whenever possible. In cases where the content is not cached, because the cache entry has expired or the cache has been flushed etc., the content will be generated and a new cache entry will be created.

Cache entries are removed either when their specified cache lifetime expires, the associated widget instance is deleted, or the hyva_admin_dashboard cache is flushed.

Cache Keys

When storing widget instance content in the cache, the cache key is hyva_admin_dashboard:widget:{{WIDGET_TYPE_ID}}:display_data:{{WIDGET_INSTANCE_ID}}. The format of the cache key can be changed by creating a plugin for the Hyva\AdminDashboardFramework\Model\Cache\Type\AdminDashboard::getWidgetInstanceDisplayDataCacheKey function.