Mystified by laminas-mvc app configuration cache

I’ve just put a pretty substantial laminas-mvc project into production, assuming it would be easy to turn on application configuration caching. My recollection, last time I did this, was that all you had to do was provide the right answers in config/application.config.php, i.e.,

    'config_cache_enabled' => true,     
    'config_cache_key' => 'application.config.cache',   
    'module_map_cache_enabled' => true,
    'module_map_cache_key' => 'application.module.cache',
    'cache_dir' => 'data/cache',

and that did the trick. I’ve read https://docs.laminas.dev/laminas-mvc/services/#application-configuration-options and it doesn’t seem to say otherwise. I thought there was a way to set this up with pure configuration. Then I started reading https://docs.laminas.dev/laminas-config-aggregator/caching/ but I still don’t understand what code goes where in order to make file-based caching happen. It seems to be either failing silently, or not even trying.

I hope this is enough information but if it isn’t, slap me and I’ll try harder.

Any ideas? Thanks.

If you used https://github.com/laminas/laminas-mvc-skeleton as a starting point, then you should have a composer script related to that. Try:

composer development-disable

If you did not, that might still be a starting point to explore what this script does and how to replicate that in your specific app.

@powerkiki thanks for the suggestion. Since posting, I did figure out that (not surprisingly) the fault is in my code somewhere, not the framework’s, by creating a new skeleton app and fiddling with composer development-(enable|disable). Again, no surprise, but one always has to rule that out.

I believe I started with the skeleton, but it was 4+ years ago; it was ZF2, became ZF3, became Laminas, and has diverged vastly from the skeleton. Either I must have removed those composer scripts from my composer.json or else they didn’t exist back then.


UPDATE:

composer require laminas/laminas-development-mode and the rest is simple.

Thanks!