# Mystified by laminas-mvc app configuration cache

**URL:** <https://discourse.laminas.dev/t/mystified-by-laminas-mvc-app-configuration-cache/1560>\
**Category:** Components & MVC\
**Created:** [April 26, 2020, 9:29pm UTC](https://discourse.laminas.dev/t/mystified-by-laminas-mvc-app-configuration-cache/1560 "2020-04-26T21:29:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidmintz](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/davidmintz/32/213_2.png) [@davidmintz](https://discourse.laminas.dev/u/davidmintz)\
**Post date:** [April 26, 2020, 9:29pm UTC](https://discourse.laminas.dev/t/mystified-by-laminas-mvc-app-configuration-cache/1560/1 "2020-04-26T21:29:43Z")

</div>

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](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/](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.

---

<div class="post-metadata">

**Author:** ![PowerKiKi](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/powerkiki/32/48_2.png) [@PowerKiKi](https://discourse.laminas.dev/u/PowerKiKi)\
**Post date:** [April 27, 2020, 8:52am UTC](https://discourse.laminas.dev/t/mystified-by-laminas-mvc-app-configuration-cache/1560/2 "2020-04-27T08:52:56Z")

</div>

If you used [https://github.com/laminas/laminas-mvc-skeleton](https://github.com/laminas/laminas-mvc-skeleton) as a starting point, then you should have a [composer script](https://github.com/laminas/laminas-mvc-skeleton/blob/be58af5e8ae979b2145bc958946ba962abbccd79/composer.json#L113-L115) related to that. Try:

```auto
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.

---

<div class="post-metadata">

**Author:** ![davidmintz](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/davidmintz/32/213_2.png) [@davidmintz](https://discourse.laminas.dev/u/davidmintz)\
**Post date:** [April 27, 2020, 1:10pm UTC](https://discourse.laminas.dev/t/mystified-by-laminas-mvc-app-configuration-cache/1560/3 "2020-04-27T13:10:17Z")

</div>

@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!
