Cached directories
Published
Updated
📁
Speed up deployments.
Cached directories keep folders like vendor and node_modules in the fortrabbit deployment service from one deployment to the next, so Composer and npm do not download every dependency again.
When the repository contains a deploy file, this setting is managed there and cannot be edited in the dashboard.
Dependencies kept between deployments
The build commands usually include composer install or npm install, which fill the vendor and node_modules folders. A cached directory stays in the deployment service after the build, so the next build only fetches what changed. The first deployment takes longest.
The cache lives in the deployment service, not in the environment. Whether a cached folder also reaches the environment depends on the exclude patterns.
Paths start at the Git repository root. A leading slash is optional, so /vendor/symfony and vendor/symfony are equivalent. vendor matches the root directory and all subdirectories.
Default settings
node_modules
vendor
.pnpm-store
The software template can set others. To turn caching off, save an empty value.
Purging cached directories
Purge the cache when a build keeps failing on a broken dependency, for example after an interrupted install. The purge button in the deployment settings marks the cache for deletion: the next deployment starts with empty folders and builds a new cache.
Sometimes the platform will also decide to purge the cache on its own, so don't store any essential data here. The cached directory feature is only intended to speed up builds, your build should still work when these directories start empty.