Skip to main content
The bundle caches the resolved menu tree — the raw menu and items result — per combination of (menuCode, locale, contextSets). This avoids repeated database hits and N+1 queries when the same menu is rendered multiple times per request or across requests.

Options

cache.ttl
integer
default:"60"
Time-to-live in seconds for each cached menu tree. The minimum value is 60. Lower values are rejected by the configuration validator.
cache.pool
string
default:"cache.app"
PSR-6 cache pool service name. Set to null or an empty string to disable the tree cache entirely.
config/packages/nowo_dashboard_menu.yaml
nowo_dashboard_menu:
    cache:
        ttl: 60
        pool: cache.app

Disabling the cache

Set pool to null or an empty string to disable caching. Every request will then query the database directly.
config/packages/nowo_dashboard_menu.yaml
nowo_dashboard_menu:
    cache:
        pool: ~    # null — cache disabled

What is cached

The cache stores the raw menu and its items indexed by the tuple (menuCode, locale, contextSets). Each unique combination is a separate cache entry with its own TTL.
In production, use a dedicated cache pool (e.g. Redis or Memcached) rather than cache.app to get better isolation and avoid cache eviction contention with other parts of your application.
config/packages/nowo_dashboard_menu.yaml
nowo_dashboard_menu:
    cache:
        ttl: 300
        pool: cache.redis_menu   # a custom pool defined in framework.cache
Define the custom pool in your framework cache configuration:
config/packages/cache.yaml
framework:
    cache:
        pools:
            cache.redis_menu:
                adapter: cache.adapter.redis
                default_lifetime: 3600