Skip to content

Caching and Performance ​

The SDK moves the work it can to build time and keeps the runtime predictable. This page describes the caches the SDK maintains and the rules that keep query performance stable.

What gets cached ​

CacheProducerConsumer
Registry cache, bootstrap/cache/ui5.phpui5:cachePlatform\CachedRegistry
Navigation cache, bootstrap/cache/ui5-nav.phpui5:navCachedNavigationService, only when bound as ui5.navigation_service
Help output, storage/ui5/help/ (HTML, toc.html, index.json)ui5:help --allHelpController, TocController, HelpIndexController

The build-time / runtime split ​

Run the build steps on every deploy, in this order:

bash
php artisan ui5:sync
php artisan ui5:cache      # after ui5:sync: it bakes the sync-assigned ability ids
php artisan ui5:nav
php artisan ui5:help --all

ui5:cache builds from the live SdkRegistry whichever registry is bound.

Navigation. The default ui5.navigation_service is DefaultNavigationService, which builds navigation from the registry in memory. To serve the compiled file instead, bind the cached service:

php
// config/ui5.php
'navigation_service' => \LaravelUi5\Sdk\Shell\Navigation\CachedNavigationService::class,

CachedNavigationService throws if bootstrap/cache/ui5-nav.php is missing, so run ui5:nav before the first request.

Help. Help is always compiled; the runtime never parses Markdown. See Help Build Pipeline.

Either registry works in production

Production runs fine with either registry. Since 1.2.0 binding CachedRegistry no longer costs you the deploy: ui5:sync, ui5:cache and ui5:nav reach past the binding to the live registry, so the commands that build the caches keep working while the cached one serves requests.

Query stability rules ​

  • No N+1. Authorization resolution is one UNION ALL query (AbilityGrantQuery). Helper resolvers must follow the same discipline.
  • No PHP-side security filtering. Visibility is enforced at query level; see Visibility & CmdK Separation.
  • Positional parameters only in security queries. SQLite-safe and portable across MySQL and PostgreSQL.
  • Index the validity columns. valid_from and valid_until are part of every authorization filter; production deployments should make sure they are indexed.

See also ​