yahoojapan/config-cache-bundle
A Symfony bundle for Yahoo Japan that caches configuration values, letting you load and reuse config data efficiently without repeated parsing. Useful for projects needing lightweight config caching within a Symfony bundle context.
Architecture fit — fundamental mismatch. Despite the framing, yahoojapan/config-cache-bundle is a Symfony bundle, not a Laravel package. It ships a Bundle subclass, a DI extension, and compiler passes that only register against Symfony's Kernel/ContainerBuilder. None of that bootstrapping has an analogue in Laravel's service container. Equally important, the problem it solves is largely already solved differently in each framework:
php artisan config:cache compiles the entire config/ tree into one PHP file — fast, but coarse-grained and invalidated only on deploy.ConfigCache (what this bundle wraps): per-resource caching with an isFresh() mtime check, so individual user-defined config files can be re-parsed only when they change.That per-file freshness model is the only genuinely differentiated capability here, and it is not what Laravel's config cache does. So there is a real (if narrow) use case — runtime-editable config files, multi-tenant config, drop-in config directories — but this package is the wrong delivery vehicle for it.
Integration feasibility — low. Realistic options, in order of preference:
symfony/config directly (the maintained upstream component Laravel does not ship but can install). ConfigCache and ConfigCacheFactory are ~standalone classes with no kernel dependency. This captures 90% of the value with none of the abandonment risk.Technical risk — high, bordering on disqualifying.
php: ^5.5|^7.0 and symfony/*: ^2.7|^3.0. Laravel 10/11/12 require PHP 8.1+ and Symfony 6/7. Composer will either refuse to resolve or you'll --ignore-platform-reqs your way into runtime fatals (removed each(), dynamic property deprecations, Serializable changes, untyped signature mismatches).Key questions for the team:
symfony/config or in-house code.Stack fit. Poor as a dependency, good as a pattern. The architectural idea — cache parsed user config, key it by source file, invalidate on mtime — maps cleanly onto Laravel idioms if implemented natively.
Recommended path (do not install the bundle):
symfony/config to composer.json (it is versioned and maintained independently; current releases track PHP 8.x).ConfigCacheFactory with a Laravel-backed cache directory (storage/framework/cache/config-resources) and a PSR-3 logger.config:cache / deploy hooks.Migration path. If an existing Symfony 2.x/3.x service uses the bundle, do not port the bundle forward; port the contract. Extract the call sites behind an interface, implement it twice (bundle-backed in the legacy app, native in the target app), and cut over per-consumer. This avoids a big-bang rewrite and lets you run both in parallel during the transition.
Compatibility. Two hard gates: PHP 8.1+ (Laravel 10+) and Symfony 6/7 components. The bundle fails both. Even in a Symfony app, ^3.0 components are EOL and unsupported. Treat the bundle as incompatible by default and require an explicit, documented exception to use it.
Sequencing.
php artisan config:cache against the proposed resource cache on a representative config set. In most Laravel apps the built-in cache, loaded once per request from opcache, is faster than an isFresh() stat call per file.symfony/config, behind a feature flag.Maintenance. Effectively unbounded. There is no maintainer, no release cadence, and no upgrade path. Adopting it means forking it, and forking it means owning PHP 8 compatibility, Symfony 6/7 compatibility, and any future security surface yourself — for a component that is ~150 lines of glue. The cost/benefit is inverted: you would be maintaining a dependency to avoid writing the code it contains. If adopted, pin by commit hash (no tags will move), vendor the source, and record it on the technical-debt register with a named owner and a removal date.
Support. Zero. No vendor, no community, no issue triage, no security advisories. Internal support means one or two engineers reading 2016 source. Bus factor is a genuine risk — document the caching semantics (key derivation, freshness predicate, atomicity of writes) in-repo, because that knowledge will not exist anywhere else.
Scaling. The cache is local filesystem state, which is the sharp edge in any multi-node deployment:
Mitigations: warm during deploy (never on first request), back the cache with shared storage only if mtime semantics are proven reliable, or move to a content-hash key in Redis instead of mtime-on-disk.
Failure modes to instrument:
rsync/cp -p, coarse timestamp granularity, clock skew across nodes). Result: config changes that never take effect, with no error. Highest-severity mode; needs a hit/miss counter and a "cache age" gauge.included; any PHP 8 incompatibility in the compiled output becomes a hard 500 on every request until the cache is manually cleared. Combined with an abandoned package, this is the failure mode that argues most strongly against adoption.Ramp-up. Learning the bundle's API is trivial (small surface, two or three classes). Learning its failure characteristics is not — those only surface under multi-node deploy, load, or a PHP upgrade. Budget a half-day to read the source and an on-call runbook entry covering "clear the resource cache" as the first response to config anomalies. Onboarding cost is low; ownership cost is the real number, and it is high relative to the value delivered.
Verdict. Do not adopt as a dependency. The underlying pattern is worth ~1 engineer-week to implement natively on symfony/config (or to skip entirely if config:cache already meets the latency target), and that path is strictly cheaper than owning a 2016 Symfony bundle inside a Laravel application.
How can I help you explore Laravel packages today?