Skip to main content

Caching

Caching is governed by two flags. Everything below is on only when CACHE=true and DEBUG=false. Debug mode disables all of it, which is why development sees template and route changes immediately.

The cache pools

A filesystem-backed PSR-6 pool is available to any service, with a PSR-16 wrapper for simpler uses:
The cache is disposable. Clearing it, or a deployment, removes everything, so never keep state there that has to survive.

Clearing

Shared\Infrastructure\CacheManager::clearCache() clears both pools, empties the cache directory, and rebuilds the browser translation catalogs. It’s exposed in the admin panel under Status → Clear cache, and it runs automatically when a plugin is installed, activated, deactivated or uninstalled. Clear the cache after:
  • Adding or changing a route, in an installation with caching on
  • Changing a template on a cached installation
  • Editing translation catalogs
  • Any manual change inside extra/extensions/
If clearing reports success but nothing changes, check ownership of var/cache. A cron job running as a different user than the web server is the usual cause.

Logging

Two rotating handlers write to var/log:
Pass context as an array rather than interpolating it into the message, so entries stay searchable.

Unhandled errors

When an exception reaches the exception middleware and isn’t one it maps, it generates a correlation ID, logs the exception with the request path and method, and returns:
Search that ID in var/log/error-*.log to find the trace. Non-API requests get an empty 500 instead, with the same log entry. With DEBUG=true the exception is rethrown rather than logged and swallowed, so you see it directly.

Plugin failures

A plugin that fatals while booting is recorded in var/plugin-health.json and skipped afterwards, so one broken plugin can’t take the installation down. See Debugging plugins.

What to watch in production