Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,200 of 9,200 pages
About the help in other languages
All help pages

Caches and autoloads after building

What a bundle build and an update must refresh - the autoload arrays (ezpgenerateautoloads.php -e, -k, -o, .autoloadignore), the caches (ezcache.php --clear-tag, --clear-id, --clear-all, cache.php), Velocity's workers…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/bundlers/caches-and-autoloads-after-building.md

On this page

Caches and autoloads after building

This page is for bundlers who build images and packages, and for anyone who updates a bundled installation. A build that forgets the autoload arrays ships a site that cannot find its classes; one that forgets the caches ships stale settings and templates.

Contents

  1. Autoload arrays
  2. Caches
  3. The order after a code change
  4. In a bundle build
  5. In a bundle update

Autoload arrays

"Exponential finds classes through generated autoload arrays in autoload/ (the kernel) and var/autoload/ (the extensions). A class that is not in an array is not found, even if its file is in place" (10.7 Class autoloads).

php bin/php/ezpgenerateautoloads.php -e        # extensions: after adding, renaming or removing a class
php bin/php/ezpgenerateautoloads.php -k        # the kernel: only when kernel/ or lib/ changed
php bin/php/ezpgenerateautoloads.php -o        # kernel overrides
php bin/php/ezpgenerateautoloads.php -e -n     # dry run: report, write nothing

The options of the script (kernel/private/classes/commands/ezpgenerateautoloads.php) also include -q, -v, -p (progress), -s (tests), -t (target), --exclude and --allow-root-user. "An option it does not know stops it with exit status 1 and nothing written", so a build script can rely on its status.

.autoloadignore in the installation root limits which directories are walked; "The shipped file excludes vendor ..., ai, var and .claude". Add your own working directories to it if your build tree has any. Composer's post-install-cmd of the kernel already runs php bin/php/ezpgenerateautoloads.php; a bundle with its own root composer.json adds the same script (Composer-based bundles).

Caches

bin/php/ezcache.php takes --clear-tag, --clear-id, --clear-all, --list-tags, --list-ids, and --purge with its --iteration-sleep, --iteration-max and --expiry options (kernel/private/classes/commands/ezcache.php).

You changedClear
an .ini setting--clear-tag=ini (not --clear-id=ini, which misses the global INI cache)
a .tpl file--clear-tag=template
a new template, override rule, extension or design--clear-id=template-override,design_base
a stylesheet or script--clear-id=ezjscore-packer,template-block, then the Velocity cache
content looks stale--clear-tag=content
unsure--clear-all

Source: Which to clear. php bin/php/cache.php (console exp:cache) reaches the caches in front of PHP as well: static, HTTP, Velocity's response cache, OPcache (The caches in front of PHP).

The order after a code change

"A page rendered by the old code between a cache clear and a PHP reload is cached again and looks as if the change had not worked. The order is: INI and template caches, then reload PHP-FPM and restart Velocity, and only then the content, HTTP, template-block and response caches." Under Velocity, exp:velocity deploy does it in that order, with PASS or FAIL per step (The order after a code change).

In a bundle build

  1. composer install from the lock file (its script regenerates the arrays), or run ezpgenerateautoloads.php yourself.
  2. php bin/php/ezpgenerateautoloads.php -e after adding your extensions.
  3. Do not ship var/cache/ from the build; the site builds its caches on first use.
  4. Check: php bin/php/console exp:checkclasses "loads every declared class and reports those PHP refuses to load".

In a bundle update

  1. Put the new code in place (image, package, Git and Composer).
  2. Regenerate the arrays (-e; -k when kernel files changed).
  3. Apply the database update if the release needs one (Updates and upgrade paths).
  4. Clear in the documented order, or run exp:velocity deploy (--kernel when a kernel class was added or renamed).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x